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:
josh 2009-04-04 17:21:38 +00:00
parent 3b279c663f
commit c18371da07
11 changed files with 55 additions and 71 deletions

View File

@ -1,5 +1,6 @@
SHELL := bash
TARGET := jcad
export GTKMM_VERSION := 2.4
export GTKGLEXTMM_VERSION := 1.2
@ -9,14 +10,14 @@ export CPPFLAGS += -I"$(shell cd)"
else
export CPPFLAGS += -I"$(shell pwd)"
endif
export CXXFLAGS := -Wall -O2
export CXXFLAGS := -Wall -O2 \
`pkg-config --cflags gtkmm-$(GTKMM_VERSION)` \
`pkg-config --cflags gtkglextmm-$(GTKGLEXTMM_VERSION)`
export LDFLAGS := `pkg-config --libs gtkmm-$(GTKMM_VERSION)` \
`pkg-config --libs gtkglextmm-$(GTKGLEXTMM_VERSION)`
SUBDIRS := engine gui main
all: $(TARGET)
.PHONY: $(TARGET)
$(TARGET):
@for d in $(SUBDIRS); \

View File

@ -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

View File

@ -1,30 +1,23 @@
SRCS := MainWindow.cpp GUI.cpp Displayer.cpp ProfileDisplayer.cpp PartDisplayer.cpp
MODULES := MainWindow.o GUI.o Displayer.o ProfileDisplayer.o PartDisplayer.o
TARGET := gui.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

View File

@ -1,26 +1,23 @@
SRCS := main.cpp
MODULES := main.o
TARGET := main.a
DEPS := $(SRCS:.cpp=.d)
CPPFLAGS := -I..
CXXFLAGS := -O2 $(CPPFLAGS)
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