diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-06-29 05:50:44 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-06-29 05:50:44 +0000 |
commit | 937d960d2677c87ac6d68dc5445be115ac001d3e (patch) | |
tree | 35b33aebb0cab5073fc0778f13f2425d3e18278f | |
parent | dcd914665f6e8ea6ea4e648f7357f1c842273d87 (diff) | |
download | libbu++-937d960d2677c87ac6d68dc5445be115ac001d3e.tar.gz libbu++-937d960d2677c87ac6d68dc5445be115ac001d3e.tar.bz2 libbu++-937d960d2677c87ac6d68dc5445be115ac001d3e.tar.xz libbu++-937d960d2677c87ac6d68dc5445be115ac001d3e.zip |
Completely switched over to the much simpler, nicer pymake. Things look great,
and the old Makefile may soon fall into disrepair. To use the old one, which
should almost always be able to build at least thi library, call:
make -f Makefile.legacy
The new Makefile just calls pymake
Diffstat (limited to '')
-rw-r--r-- | Makefile | 80 | ||||
-rw-r--r-- | Makefile.legacy | 78 | ||||
-rw-r--r-- | pymake.conf | 44 | ||||
-rw-r--r-- | src/test/hashtest/hashtest.cpp (renamed from src/test/hashtest.cpp) | 0 | ||||
-rw-r--r-- | src/test/log/log.cpp (renamed from src/test/log.cpp) | 0 | ||||
-rw-r--r-- | src/test/md5test/md5test.cpp (renamed from src/test/md5test.cpp) | 0 | ||||
-rw-r--r-- | src/test/param/param.cpp (renamed from src/test/param.cpp) | 0 | ||||
-rw-r--r-- | src/test/param/param.h (renamed from src/test/param.h) | 0 | ||||
-rw-r--r-- | src/test/serialize/serialize.cpp (renamed from src/test/serialize.cpp) | 0 | ||||
-rw-r--r-- | src/test/serializetext/serializetext.cpp (renamed from src/test/serializetext.cpp) | 0 | ||||
-rw-r--r-- | src/test/xmlreadtest/xmlreadtest.cpp (renamed from src/test/xmlreadtest.cpp) | 0 | ||||
-rw-r--r-- | src/test/xmlrepltest/xmlrepltest.cpp (renamed from src/test/xmlrepltest.cpp) | 0 | ||||
-rw-r--r-- | src/test/xmlwritetest/xmlwritetest.cpp (renamed from src/test/xmlwritetest.cpp) | 0 | ||||
-rw-r--r-- | src/unit/hashtable/hashtable.cpp (renamed from src/unit/hashtable.cpp) | 0 | ||||
-rw-r--r-- | src/unit/xml/xml.cpp (renamed from src/unit/xml.cpp) | 0 |
15 files changed, 125 insertions, 77 deletions
@@ -1,78 +1,4 @@ | |||
1 | OBJS:=$(patsubst %.cpp,%.o,$(wildcard src/*.cpp)) | 1 | .PHONY: pymake |
2 | USRCS:=$(wildcard src/unit/*.cpp) | ||
3 | UOBJS:=$(patsubst %.cpp,%.o,$(USRCS)) | ||
4 | UNIT:=$(foreach ut,$(patsubst %.cpp,%,$(wildcard src/unit/*.cpp)),unit/$(notdir $(ut))) | ||
5 | TOBJS:=$(patsubst %.cpp,%.o,$(wildcard src/test/*.cpp)) | ||
6 | TDIRS:=$(filter-out %.o %.cpp %.h %.d,$(wildcard src/test/*)) | ||
7 | TESTS:=$(patsubst src/test/%.o,tests/%,$(TOBJS)) $(patsubst src/test/%,tests/%,$(TDIRS)) | ||
8 | ATOBJS:=$(TOBJS) $(patsubst %.cpp,%.o,$(foreach dr,$(TDIRS),$(wildcard $(dr)/*.cpp))) | ||
9 | LIB:=libbu++.a | ||
10 | DATE:=$(shell date +%F) | ||
11 | |||
12 | TXTCPP:="\ g++:\ \ \ " | ||
13 | TXTLNK:="\ \ ld:\ \ \ " | ||
14 | TXTDEP:="\ dep:\ \ \ " | ||
15 | TXTARC:="\ \ ar:\ \ \ " | ||
16 | |||
17 | .PHONY: all clean dist tests depclean cleanapi | ||
18 | .SILENT: clean $(OBJS) $(TOBJS) $(ATOBJS) $(UNIT) $(UOBJS) $(TESTS) $(patsubst %.o,%.d,$(OBJS) $(TOBJS) $(ATOBJS) $(UOBJS) $(TESTS)) $(LIB) | ||
19 | |||
20 | all: libbu++.a | ||
21 | |||
22 | depclean: | ||
23 | -rm $(patsubst %.o,%.d,$(OBJS) $(ATOBJS) $(UOBJS)) | ||
24 | |||
25 | -include $(patsubst %.o,%.d,$(OBJS) $(ATOBJS) $(UOBJS)) | ||
26 | |||
27 | clean: | ||
28 | -rm $(OBJS) $(ATOBJS) $(UOBJS) $(TESTS) $(LIB) | ||
29 | |||
30 | # This bit I cribbed from the docs, seems to work great though! | ||
31 | %.d: %.cpp | ||
32 | echo "$(TXTDEP)$@" | ||
33 | g++ $(CXXFLAGS) -Isrc -M $(CPPFLAGS) $< | sed 's,\($(notdir $*)\)\.o[: ]*,$(dir $*)\1.o $@: ,g' > $@ | ||
34 | |||
35 | %.o: %.cpp | ||
36 | echo "$(TXTCPP)$@" | ||
37 | g++ -fPIC $(CXXFLAGS) -Isrc $(foreach dr,$(filter $(dir $@),$(foreach ddr,$(TDIRS),$(ddr)/)),-I$(dr)) -ggdb -c -o $@ $< | ||
38 | |||
39 | $(LIB): $(OBJS) | ||
40 | echo "$(TXTARC)$@" | ||
41 | ar cr $(LIB) $(OBJS) | ||
42 | |||
43 | $(TESTS): $(ATOBJS) $(LIB) | ||
44 | echo "$(TXTLNK)$@" | ||
45 | g++ $(LDFLAGS) -ggdb $(filter %$(patsubst tests/%,%,$@).o, $(TOBJS) ) $(patsubst %.cpp,%.o,$(wildcard $(filter %$(patsubst tests/%,%,$@), $(TDIRS))/*.cpp)) -L. -lbu++ -ldl -o $@ | ||
46 | |||
47 | $(UNIT): $(USRCS) $(LIB) | ||
48 | echo "$(TXTLNK)$@" | ||
49 | g++ $(LDFLAGS) -ggdb -Isrc -Isrc/unit src/$@.cpp -L. -lbu++ -lcpptest -o $@ | ||
50 | |||
51 | tests: $(TESTS) | ||
52 | |||
53 | unit: $(UNIT) | ||
54 | |||
55 | dist: clean depclean | ||
56 | mkdir libbu++-$(DATE) | ||
57 | cp -a --target-directory=libbu++-$(DATE) Makefile src | ||
58 | tar --exclude=\.svn -c libbu++-$(DATE) | bzip2 -9 > libbu++-$(DATE).tar.bz2 | ||
59 | rm -Rf libbu++-$(DATE) | ||
60 | |||
61 | install: libbu++.a | ||
62 | cat src/*.h | grep -v "#include \"" - > libbu++.h | ||
63 | cp -a libbu++.a $(PREFIX)/lib | ||
64 | cp -a libbu++.h $(PREFIX)/include | ||
65 | |||
66 | cleanapi: | ||
67 | -rm -Rf api | ||
68 | |||
69 | api: $(SRC) | ||
70 | -rm -Rf api | ||
71 | doxygen | ||
72 | make -C api/latex | ||
73 | |||
74 | #tests: $(TOBJS) $(LIB) | ||
75 | # for file in $(patsubst src/test/%.o,%,$(TOBJS)); \ | ||
76 | # do g++ -o $$file src/test/$$file.o -L. -lbu++; \ | ||
77 | # done | ||
78 | 2 | ||
3 | pymake: | ||
4 | pymake | ||
diff --git a/Makefile.legacy b/Makefile.legacy new file mode 100644 index 0000000..0afb4a0 --- /dev/null +++ b/Makefile.legacy | |||
@@ -0,0 +1,78 @@ | |||
1 | OBJS:=$(patsubst %.cpp,%.o,$(wildcard src/*.cpp)) | ||
2 | USRCS:=$(wildcard src/unit/*.cpp) | ||
3 | UOBJS:=$(patsubst %.cpp,%.o,$(USRCS)) | ||
4 | UNIT:=$(foreach ut,$(patsubst %.cpp,%,$(wildcard src/unit/*.cpp)),unit/$(notdir $(ut))) | ||
5 | TOBJS:=$(patsubst %.cpp,%.o,$(wildcard src/test/*.cpp)) | ||
6 | TDIRS:=$(filter-out %.o %.cpp %.h %.d,$(wildcard src/test/*)) | ||
7 | TESTS:=$(patsubst src/test/%.o,tests/%,$(TOBJS)) $(patsubst src/test/%,tests/%,$(TDIRS)) | ||
8 | ATOBJS:=$(TOBJS) $(patsubst %.cpp,%.o,$(foreach dr,$(TDIRS),$(wildcard $(dr)/*.cpp))) | ||
9 | LIB:=libbu++.a | ||
10 | DATE:=$(shell date +%F) | ||
11 | |||
12 | TXTCPP:="\ g++:\ \ \ " | ||
13 | TXTLNK:="\ \ ld:\ \ \ " | ||
14 | TXTDEP:="\ dep:\ \ \ " | ||
15 | TXTARC:="\ \ ar:\ \ \ " | ||
16 | |||
17 | .PHONY: all clean dist tests depclean cleanapi | ||
18 | .SILENT: clean $(OBJS) $(TOBJS) $(ATOBJS) $(UNIT) $(UOBJS) $(TESTS) $(patsubst %.o,%.d,$(OBJS) $(TOBJS) $(ATOBJS) $(UOBJS) $(TESTS)) $(LIB) | ||
19 | |||
20 | all: libbu++.a | ||
21 | |||
22 | depclean: | ||
23 | -rm $(patsubst %.o,%.d,$(OBJS) $(ATOBJS) $(UOBJS)) | ||
24 | |||
25 | -include $(patsubst %.o,%.d,$(OBJS) $(ATOBJS) $(UOBJS)) | ||
26 | |||
27 | clean: | ||
28 | -rm $(OBJS) $(ATOBJS) $(UOBJS) $(TESTS) $(LIB) | ||
29 | |||
30 | # This bit I cribbed from the docs, seems to work great though! | ||
31 | %.d: %.cpp | ||
32 | echo "$(TXTDEP)$@" | ||
33 | g++ $(CXXFLAGS) -Isrc -M $(CPPFLAGS) $< | sed 's,\($(notdir $*)\)\.o[: ]*,$(dir $*)\1.o $@: ,g' > $@ | ||
34 | |||
35 | %.o: %.cpp | ||
36 | echo "$(TXTCPP)$@" | ||
37 | g++ -fPIC $(CXXFLAGS) -Isrc $(foreach dr,$(filter $(dir $@),$(foreach ddr,$(TDIRS),$(ddr)/)),-I$(dr)) -ggdb -c -o $@ $< | ||
38 | |||
39 | $(LIB): $(OBJS) | ||
40 | echo "$(TXTARC)$@" | ||
41 | ar cr $(LIB) $(OBJS) | ||
42 | |||
43 | $(TESTS): $(ATOBJS) $(LIB) | ||
44 | echo "$(TXTLNK)$@" | ||
45 | g++ $(LDFLAGS) -ggdb $(filter %$(patsubst tests/%,%,$@).o, $(TOBJS) ) $(patsubst %.cpp,%.o,$(wildcard $(filter %$(patsubst tests/%,%,$@), $(TDIRS))/*.cpp)) -L. -lbu++ -ldl -o $@ | ||
46 | |||
47 | $(UNIT): $(USRCS) $(LIB) | ||
48 | echo "$(TXTLNK)$@" | ||
49 | g++ $(LDFLAGS) -ggdb -Isrc -Isrc/unit src/$@.cpp -L. -lbu++ -lcpptest -o $@ | ||
50 | |||
51 | tests: $(TESTS) | ||
52 | |||
53 | unit: $(UNIT) | ||
54 | |||
55 | dist: clean depclean | ||
56 | mkdir libbu++-$(DATE) | ||
57 | cp -a --target-directory=libbu++-$(DATE) Makefile src | ||
58 | tar --exclude=\.svn -c libbu++-$(DATE) | bzip2 -9 > libbu++-$(DATE).tar.bz2 | ||
59 | rm -Rf libbu++-$(DATE) | ||
60 | |||
61 | install: libbu++.a | ||
62 | cat src/*.h | grep -v "#include \"" - > libbu++.h | ||
63 | cp -a libbu++.a $(PREFIX)/lib | ||
64 | cp -a libbu++.h $(PREFIX)/include | ||
65 | |||
66 | cleanapi: | ||
67 | -rm -Rf api | ||
68 | |||
69 | api: $(SRC) | ||
70 | -rm -Rf api | ||
71 | doxygen | ||
72 | make -C api/latex | ||
73 | |||
74 | #tests: $(TOBJS) $(LIB) | ||
75 | # for file in $(patsubst src/test/%.o,%,$(TOBJS)); \ | ||
76 | # do g++ -o $$file src/test/$$file.o -L. -lbu++; \ | ||
77 | # done | ||
78 | |||
diff --git a/pymake.conf b/pymake.conf new file mode 100644 index 0000000..810e3c6 --- /dev/null +++ b/pymake.conf | |||
@@ -0,0 +1,44 @@ | |||
1 | ### pymake by ~3o~ph()g (neonphog.com) ### | ||
2 | ## This skeleton file was generated by pymake... please edit for your project. | ||
3 | |||
4 | [BUILD] | ||
5 | DIR: src | ||
6 | COMMAND: lib | ||
7 | OUTPUT: libbu++.a | ||
8 | |||
9 | [DIRBUILD] | ||
10 | COMMAND: exe | ||
11 | OUTPUT: tests/{NAME} | ||
12 | ROOT: src/test | ||
13 | LDFLAGS: -L. -lbu++ | ||
14 | CXXFLAGS: -Isrc -Isrc/test | ||
15 | |||
16 | [OVERRIDE] | ||
17 | FILE: tests/plugin | ||
18 | LDFLAGS: -ldl | ||
19 | |||
20 | [DIRBUILD] | ||
21 | COMMAND: exe | ||
22 | OUTPUT: unit/{NAME} | ||
23 | ROOT: src/unit | ||
24 | LDFLAGS: -L. -lbu++ -lcpptest | ||
25 | CXXFLAGS: -Isrc | ||
26 | |||
27 | [TRIGGER] | ||
28 | INPUT: .cpp #take input of *.cpp files | ||
29 | OUTPUT: .o #output .o files | ||
30 | COMMAND: g++ -c {INPUT} {CXXFLAGS} -I{DIR} -o {OUTPUT} | ||
31 | CHECK: g++ -M {INPUT} {CXXFLAGS} -I{DIR} | ||
32 | |||
33 | ### Executable command ### | ||
34 | ## Use this command if you want a simple executable | ||
35 | [COMMAND] | ||
36 | NAME: exe | ||
37 | COMMAND: g++ {INPUT} {LDFLAGS} -o {OUTPUT} | ||
38 | |||
39 | ### Library command ### | ||
40 | ## Use this command if you wish to create a library | ||
41 | [COMMAND] | ||
42 | NAME: lib | ||
43 | COMMAND: ar cr{ARFLAGS} {OUTPUT} {INPUT} | ||
44 | |||
diff --git a/src/test/hashtest.cpp b/src/test/hashtest/hashtest.cpp index f31a3f8..f31a3f8 100644 --- a/src/test/hashtest.cpp +++ b/src/test/hashtest/hashtest.cpp | |||
diff --git a/src/test/log.cpp b/src/test/log/log.cpp index d7cfa0b..d7cfa0b 100644 --- a/src/test/log.cpp +++ b/src/test/log/log.cpp | |||
diff --git a/src/test/md5test.cpp b/src/test/md5test/md5test.cpp index 6f832df..6f832df 100644 --- a/src/test/md5test.cpp +++ b/src/test/md5test/md5test.cpp | |||
diff --git a/src/test/param.cpp b/src/test/param/param.cpp index a4d2824..a4d2824 100644 --- a/src/test/param.cpp +++ b/src/test/param/param.cpp | |||
diff --git a/src/test/param.h b/src/test/param/param.h index 2756b69..2756b69 100644 --- a/src/test/param.h +++ b/src/test/param/param.h | |||
diff --git a/src/test/serialize.cpp b/src/test/serialize/serialize.cpp index e233704..e233704 100644 --- a/src/test/serialize.cpp +++ b/src/test/serialize/serialize.cpp | |||
diff --git a/src/test/serializetext.cpp b/src/test/serializetext/serializetext.cpp index f6be7d3..f6be7d3 100644 --- a/src/test/serializetext.cpp +++ b/src/test/serializetext/serializetext.cpp | |||
diff --git a/src/test/xmlreadtest.cpp b/src/test/xmlreadtest/xmlreadtest.cpp index e2d2a0a..e2d2a0a 100644 --- a/src/test/xmlreadtest.cpp +++ b/src/test/xmlreadtest/xmlreadtest.cpp | |||
diff --git a/src/test/xmlrepltest.cpp b/src/test/xmlrepltest/xmlrepltest.cpp index 1fe9ec2..1fe9ec2 100644 --- a/src/test/xmlrepltest.cpp +++ b/src/test/xmlrepltest/xmlrepltest.cpp | |||
diff --git a/src/test/xmlwritetest.cpp b/src/test/xmlwritetest/xmlwritetest.cpp index 2986c35..2986c35 100644 --- a/src/test/xmlwritetest.cpp +++ b/src/test/xmlwritetest/xmlwritetest.cpp | |||
diff --git a/src/unit/hashtable.cpp b/src/unit/hashtable/hashtable.cpp index b2e1cf5..b2e1cf5 100644 --- a/src/unit/hashtable.cpp +++ b/src/unit/hashtable/hashtable.cpp | |||
diff --git a/src/unit/xml.cpp b/src/unit/xml/xml.cpp index e4d779c..e4d779c 100644 --- a/src/unit/xml.cpp +++ b/src/unit/xml/xml.cpp | |||