projects
/
physics.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
054d658
)
created a VERBOSE mode for the Makefile
author
Patrik Gornicz
<Gornicz.P@gmail.com>
Sat, 19 Jul 2008 17:46:15 +0000
(13:46 -0400)
committer
Patrik Gornicz
<Gornicz.P@gmail.com>
Sat, 19 Jul 2008 17:46:15 +0000
(13:46 -0400)
src/Makefile
patch
|
blob
|
blame
|
history
diff --git
a/src/Makefile
b/src/Makefile
index
10f3f93
..
a2702eb
100644
(file)
--- a/
src/Makefile
+++ b/
src/Makefile
@@
-43,32
+43,51
@@
OBJS := ${SRCS:.cpp=.o}
TARGET := ../run_physics
DEPENDS := ${SRCS:.cpp=.d}
TARGET := ../run_physics
DEPENDS := ${SRCS:.cpp=.d}
+VERBOSE := 0
+
+ifeq (${VERBOSE},0)
+ # quiet the echo command
+ Q1 := @
+ # quiet the command that is `replaced' by an echo
+ Q2 := @
+else
+ # EAT the echo command as if it was not there
+ Q1 := @true # NOTE: the space between @true and the # is VERY important!!
+ # do not quiet the command output
+ Q2 :=
+endif
.PHONY: all
all: ${TARGET}
${TARGET}: ${OBJS}
.PHONY: all
all: ${TARGET}
${TARGET}: ${OBJS}
-
@
echo "${CXX}: $@"
-
@
${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
+
${Q1}
echo "${CXX}: $@"
+
${Q2}
${CXX} ${CXXFLAGS} -o ${TARGET} $^ ${LIBS}
# how to make a depend file from a source file
%.d: %.cpp
# how to make a depend file from a source file
%.d: %.cpp
-
@
echo "DEP: $@"
-
@
${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
+
${Q1}
echo "DEP: $@"
+
${Q2}
${CXX} -M ${CXXFLAGS} $< | sed 's,: , $@: ,' > $@
#@${CXX} -M ${CXXFLAGS} $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
%.o: %.cpp
#@${CXX} -M ${CXXFLAGS} $< | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
%.o: %.cpp
-
@
echo "${CXX}: $@"
-
@
${CXX} ${CXXFLAGS} -c -o $@ $<
+
${Q1}
echo "${CXX}: $@"
+
${Q2}
${CXX} ${CXXFLAGS} -c -o $@ $<
.PHONY: clean
clean:
.PHONY: clean
clean:
- rm -f ${OBJS} ${TARGET}
+ ${Q1}echo "CLEAN: OBJS"
+ ${Q2}rm -f ${OBJS}
+ ${Q1}echo "CLEAN: TARGET"
+ ${Q2}rm -f ${TARGET}
.PHONY: distclean
distclean: clean
.PHONY: distclean
distclean: clean
- rm -f ${DEPENDS} tags prof gmon.out
+ ${Q1}echo "CLEAN: DEPENDS"
+ ${Q2}rm -f ${DEPENDS}
+ ${Q1}echo "CLEAN: tags prof gmon.out"
+ ${Q2}rm -f tags prof gmon.out
tags: ${SRCS}
ctags $^
tags: ${SRCS}
ctags $^