reworked Makefile system, renamed *.cpp to *.cc
git-svn-id: svn://anubis/jcad/trunk@33 c8684bfa-0c3a-0410-9efb-b8c82542f01e
This commit is contained in:
1 parent
3b279c663f
commit
c18371da07
11 files changed
+55
-71
No files matched your search
+17
-24
@@ -1,30 +1,23 @@
|
||||
|
||||
SRCS := Profile.cpp
|
||||
MODULES := Profile.o
|
||||
TARGET := engine.a
|
||||
GTKMM_VERSION := 2.4
|
||||
GTKGLEXTMM_VERSION := 1.2
|
||||
CPPFLAGS = -I..
|
||||
CXXFLAGS = -O2 $(CPPFLAGS) \
|
||||
`pkg-config --cflags gtkmm-$(GTKMM_VERSION)` \
|
||||
`pkg-config --cflags gtkglextmm-$(GTKGLEXTMM_VERSION)`
|
||||
DEPS := $(SRCS:.cpp=.d)
|
||||
OBJS := $(patsubst %.cc,%.o,$(wildcard *.cc))
|
||||
DEPS := $(OBJS:.o=.dep)
|
||||
|
||||
all: $(TARGET)
|
||||
all: $(DEPS) $(OBJS)
|
||||
|
||||
$(TARGET): $(MODULES)
|
||||
$(AR) rcv $@ $?
|
||||
%.o: %.cc
|
||||
$(CXX) -c -o $@ $(CPPFLAGS) $(CXXFLAGS) $<
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
$(RM) -f *.o *.d *~ $(TARGET)
|
||||
|
||||
%.d: %.cpp
|
||||
# Make dependency files
|
||||
%.dep: %.cc
|
||||
@set -e; rm -f $@; \
|
||||
$(CXX) -MM $(CPPFLAGS) $< | \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' > $@
|
||||
$(CXX) -MM $(CPPFLAGS) $< > $@.$$$$; \
|
||||
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||
rm -f $@.$$$$
|
||||
|
||||
include $(DEPS)
|
||||
clean:
|
||||
-$(RM) -f *.o *.dep
|
||||
|
||||
# Include dependency files
|
||||
ifndef CLEAN
|
||||
-include $(DEPS)
|
||||
endif
|
||||
Reference in new issue
Block a user