summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorleo2009-03-25 01:12:36 +0000
committerleo2009-03-25 01:12:36 +0000
commitadda756ae72089cdd5c3ff3cba9007b10a029e22 (patch)
treede347957a54ecc8d31d7ac330d8acd1cb9ebff92
parent76f252008d0ecaeba10e1b59c08dbcdd86465f11 (diff)
Don't print the compiler command line.
git-svn-id: http://svn.leocad.org/tags/leocad-0.75@757 c7d43263-9d01-0410-8a33-9dba5d9f93d6
-rw-r--r--Makefile29
1 files changed, 16 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 91b604b..8f6a431 100644
--- a/Makefile
+++ b/Makefile
@@ -4,31 +4,29 @@ include config.mk
### Module directories
MODULES := $(OSDIR) common
-### look for include files in
-### each of the modules
+### Look for include files in each of the modules
CPPFLAGS += $(patsubst %,-I%,$(MODULES)) $(OS)
CPPFLAGS += -g
-### extra libraries if required
+### Extra libraries if required
LIBS :=
-### each module will add to this
+### Each module will add to this
SRC :=
BIN := bin/leocad
-include $(OSDIR)/config.mk
-### include the description for
-### each module
+### Include the description for each module
include $(patsubst %,%/module.mk,$(MODULES))
-### determine the object files
+### Determine the object files
OBJ := \
$(patsubst %.c,%.o,$(filter %.c,$(SRC))) \
$(patsubst %.cpp,%.o,$(filter %.cpp,$(SRC)))
-### link the program
+### Link the program
.PHONY: all static
all: $(BIN)
@@ -44,14 +42,12 @@ bin/leocad.static: $(OBJ) bin Makefile
bin:
mkdir bin
-### include the C/C++ include
-### dependencies
+### Include the C/C++ include dependencies
ifeq ($(findstring $(MAKECMDGOALS), help config-help config clean veryclean spotless), )
-include $(OBJ:.o=.d)
endif
-### calculate C/C++ include
-### dependencies
+### Calculate C/C++ include dependencies
%.d: %.c
@[ -s $(OSDIR)/config.h ] || $(MAKE) config
@$(CC) -MM -MT '$(patsubst %.d,%.o, $@)' $(CFLAGS) $(CPPFLAGS) -w $< > $@
@@ -62,6 +58,13 @@ endif
@$(CXX) -MM -MT '$(patsubst %.d,%.o, $@)' $(CXXFLAGS) $(CPPFLAGS) -w $< > $@
@[ -s $@ ] || rm -f $@
+### Main compiler rule
+%.o: %.cpp
+ @echo $<
+ @[ -s $(OSDIR)/config.h ] || $(MAKE) config
+ @$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o '$(patsubst %.cpp,%.o, $@)' $<
+ @[ -s $@ ] || rm -f $@
+
### Various cleaning functions
.PHONY: clean veryclean spotless all
@@ -76,7 +79,7 @@ spotless: veryclean
rm -rf arch $(OSDIR)/config.mk $(OSDIR)/config.h
-### dependency stuff is done automatically, so these do nothing.
+### Dependency stuff is done automatically, so these do nothing.
.PHONY: dep depend