diff options
Diffstat (limited to '')
-rw-r--r-- | Makefile | 143 |
1 files changed, 104 insertions, 39 deletions
@@ -1,54 +1,119 @@ | |||
1 | SRC:=$(wildcard src/*.cpp) | 1 | .PHONY: all clean parser-header lexer-header build-header |
2 | OBJS:=$(patsubst %.cpp,%.o,$(SRC)) | ||
3 | VER:=r$(shell svn info | grep "Revision" | cut -d\ -f2) | ||
4 | LIBS:=bu++ | ||
5 | LIBDIRS:=$(patsubst %,lib%,$(LIBS)) | ||
6 | LIBFILES:=$(foreach dir,$(LIBDIRS),$(dir)/$(dir).a) | ||
7 | DEPFILES:=$(patsubst %.o,%.d,$(OBJS)) | ||
8 | 2 | ||
9 | .PHONY: all clean dist checklibs | 3 | .SILENT: all clean parser-header src/build.tab.c src/build.tab.o parser lexer-header src/build.yy.c src/build.yy.o lexer build-header src/builder.o src/main.o src/perform.o src/performfactory.o src/functionregexp.o src/functioncommandtolist.o src/performcommand.o src/functionfilesin.o src/functionfactory.o src/function.o src/functiontostring.o src/viewer.o src/functiondirectoriesin.o build |
10 | 4 | ||
11 | all: checklibs src/version.h build | 5 | all: parser-header parser lexer-header lexer build-header build |
12 | 6 | ||
13 | checklibs: | 7 | parser-header: |
14 | for ldir in $(LIBDIRS); do make -C $$ldir; done | 8 | echo "--- parser ---" |
15 | 9 | ||
16 | -include $(DEPFILES) | 10 | src/build.tab.c: src/build.y |
11 | echo " comp: src/build.tab.c" | ||
12 | cd src; bison ../src/build.y; cd .. | ||
17 | 13 | ||
18 | src/version.h: .svn | 14 | src/build.tab.o: src/build.tab.c |
19 | echo "#define SVNREV \"$(VER)\"" > src/version.h | 15 | echo " comp: src/build.tab.o" |
16 | g++ -c src/build.tab.c -ggdb -Ilibbu++/src -Isrc -o src/build.tab.o | ||
20 | 17 | ||
21 | %.o: %.cpp %.d | 18 | parser: src/build.tab.o |
22 | g++ -ggdb $(CXXFLAGS) -Isrc $(patsubst %,-I%/src,$(LIBDIRS)) -c -o $@ $< | 19 | echo " stupid: parser" |
20 | |||
23 | 21 | ||
24 | clean: | 22 | lexer-header: |
25 | -rm $(foreach dir,src,$(wildcard $(dir)/*.o)) build src/version.h | 23 | echo |
24 | echo "--- lexer ---" | ||
25 | |||
26 | src/build.yy.c: src/build.l | ||
27 | echo " comp: src/build.yy.c" | ||
28 | flex --bison-bridge --bison-locations -o src/build.yy.c src/build.l | ||
29 | |||
30 | src/build.yy.o: src/build.yy.c | ||
31 | echo " comp: src/build.yy.o" | ||
32 | g++ -c src/build.yy.c -ggdb -Ilibbu++/src -Isrc -o src/build.yy.o | ||
33 | |||
34 | lexer: src/build.yy.o | ||
35 | echo " stupid: lexer" | ||
36 | |||
37 | |||
38 | build-header: | ||
39 | echo | ||
40 | echo "--- build ---" | ||
41 | |||
42 | src/builder.o: src/builder.cpp | ||
43 | echo " comp: src/builder.o" | ||
44 | g++ -c src/builder.cpp -ggdb -Ilibbu++/src -Isrc -o src/builder.o | ||
45 | |||
46 | src/main.o: src/main.cpp | ||
47 | echo " comp: src/main.o" | ||
48 | g++ -c src/main.cpp -ggdb -Ilibbu++/src -Isrc -o src/main.o | ||
26 | 49 | ||
27 | depclean: | 50 | src/perform.o: src/perform.cpp |
28 | -rm $(foreach dir,src src/lib $(TOOLDIRS),$(wildcard $(dir)/*.d)) | 51 | echo " comp: src/perform.o" |
52 | g++ -c src/perform.cpp -ggdb -Ilibbu++/src -Isrc -o src/perform.o | ||
29 | 53 | ||
30 | %.d: %.cpp | 54 | src/performfactory.o: src/performfactory.cpp |
31 | g++ -Isrc -Isrc/lib $(CXXFLAGS) $(patsubst %,-I%/src,$(LIBDIRS)) -M $(CPPFLAGS) $< | sed 's,\($(patsubst src/%,%,$*)\)\.o[:]*,src/\1.o $@:,g' > $@ | 55 | echo " comp: src/performfactory.o" |
56 | g++ -c src/performfactory.cpp -ggdb -Ilibbu++/src -Isrc -o src/performfactory.o | ||
32 | 57 | ||
33 | $(LIBFILES): | 58 | src/functionregexp.o: src/functionregexp.cpp |
34 | make -C $(dir $@) $(notdir $@) | 59 | echo " comp: src/functionregexp.o" |
60 | g++ -c src/functionregexp.cpp -ggdb -Ilibbu++/src -Isrc -o src/functionregexp.o | ||
35 | 61 | ||
36 | test: | 62 | src/functioncommandtolist.o: src/functioncommandtolist.cpp |
37 | -build | 63 | echo " comp: src/functioncommandtolist.o" |
64 | g++ -c src/functioncommandtolist.cpp -ggdb -Ilibbu++/src -Isrc -o src/functioncommandtolist.o | ||
38 | 65 | ||
39 | build: $(LIBFILES) $(OBJS) | 66 | src/performcommand.o: src/performcommand.cpp |
40 | g++ -ggdb $(OBJS) -o build $(patsubst %,-L%,$(LIBDIRS)) $(patsubst %,-l%,$(LIBS)) | 67 | echo " comp: src/performcommand.o" |
68 | g++ -c src/performcommand.cpp -ggdb -Ilibbu++/src -Isrc -o src/performcommand.o | ||
41 | 69 | ||
42 | api: $(LIBSRC) $(TOOLSRC) | 70 | src/functionfilesin.o: src/functionfilesin.cpp |
43 | sed 's/PROJECT_NUMBER.*/PROJECT_NUMBER = $(VER)/' < Doxyfile > Doxyfile.tmp | 71 | echo " comp: src/functionfilesin.o" |
44 | doxygen Doxyfile.tmp | 72 | g++ -c src/functionfilesin.cpp -ggdb -Ilibbu++/src -Isrc -o src/functionfilesin.o |
45 | rm Doxyfile.tmp | ||
46 | make -C api/latex | ||
47 | 73 | ||
48 | dist: clean src/version.h | 74 | src/functionfactory.o: src/functionfactory.cpp |
49 | mkdir build-$(VER) | 75 | echo " comp: src/functionfactory.o" |
50 | cp -a --target-directory=build-$(VER) Makefile src | 76 | g++ -c src/functionfactory.cpp -ggdb -Ilibbu++/src -Isrc -o src/functionfactory.o |
51 | tar --exclude=\.svn -c build-$(VER) | bzip2 -9 > build-$(VER).tar.bz2 | 77 | |
52 | rm -Rf build-$(VER) | 78 | src/function.o: src/function.cpp |
53 | -for dir in $(LIBDIRS); do make -C $$dir dist; done | 79 | echo " comp: src/function.o" |
80 | g++ -c src/function.cpp -ggdb -Ilibbu++/src -Isrc -o src/function.o | ||
81 | |||
82 | src/functiontostring.o: src/functiontostring.cpp | ||
83 | echo " comp: src/functiontostring.o" | ||
84 | g++ -c src/functiontostring.cpp -ggdb -Ilibbu++/src -Isrc -o src/functiontostring.o | ||
85 | |||
86 | src/viewer.o: src/viewer.cpp | ||
87 | echo " comp: src/viewer.o" | ||
88 | g++ -c src/viewer.cpp -ggdb -Ilibbu++/src -Isrc -o src/viewer.o | ||
89 | |||
90 | src/functiondirectoriesin.o: src/functiondirectoriesin.cpp | ||
91 | echo " comp: src/functiondirectoriesin.o" | ||
92 | g++ -c src/functiondirectoriesin.cpp -ggdb -Ilibbu++/src -Isrc -o src/functiondirectoriesin.o | ||
93 | |||
94 | build: src/functionfactory.o src/functiontostring.o src/perform.o src/functiondirectoriesin.o src/viewer.o src/main.o src/performcommand.o src/functionregexp.o src/builder.o src/build.yy.o src/functionfilesin.o src/function.o src/performfactory.o src/functioncommandtolist.o src/build.tab.o | ||
95 | echo " exe: build" | ||
96 | g++ src/functionfactory.o src/functiontostring.o src/perform.o src/functiondirectoriesin.o src/viewer.o src/main.o src/performcommand.o src/functionregexp.o src/builder.o src/build.yy.o src/functionfilesin.o src/function.o src/performfactory.o src/functioncommandtolist.o src/build.tab.o -Llibbu++ -lbu++ -ldl -o build | ||
97 | |||
98 | clean: | ||
99 | -if [ -f src/build.tab.c ] ; then echo " rm: src/build.tab.c" ; rm src/build.tab.c ; fi | ||
100 | -if [ -f src/build.tab.o ] ; then echo " rm: src/build.tab.o" ; rm src/build.tab.o ; fi | ||
101 | -if [ -f parser ] ; then echo " rm: parser" ; rm parser ; fi | ||
102 | -if [ -f src/build.yy.c ] ; then echo " rm: src/build.yy.c" ; rm src/build.yy.c ; fi | ||
103 | -if [ -f src/build.yy.o ] ; then echo " rm: src/build.yy.o" ; rm src/build.yy.o ; fi | ||
104 | -if [ -f lexer ] ; then echo " rm: lexer" ; rm lexer ; fi | ||
105 | -if [ -f src/builder.o ] ; then echo " rm: src/builder.o" ; rm src/builder.o ; fi | ||
106 | -if [ -f src/main.o ] ; then echo " rm: src/main.o" ; rm src/main.o ; fi | ||
107 | -if [ -f src/perform.o ] ; then echo " rm: src/perform.o" ; rm src/perform.o ; fi | ||
108 | -if [ -f src/performfactory.o ] ; then echo " rm: src/performfactory.o" ; rm src/performfactory.o ; fi | ||
109 | -if [ -f src/functionregexp.o ] ; then echo " rm: src/functionregexp.o" ; rm src/functionregexp.o ; fi | ||
110 | -if [ -f src/functioncommandtolist.o ] ; then echo " rm: src/functioncommandtolist.o" ; rm src/functioncommandtolist.o ; fi | ||
111 | -if [ -f src/performcommand.o ] ; then echo " rm: src/performcommand.o" ; rm src/performcommand.o ; fi | ||
112 | -if [ -f src/functionfilesin.o ] ; then echo " rm: src/functionfilesin.o" ; rm src/functionfilesin.o ; fi | ||
113 | -if [ -f src/functionfactory.o ] ; then echo " rm: src/functionfactory.o" ; rm src/functionfactory.o ; fi | ||
114 | -if [ -f src/function.o ] ; then echo " rm: src/function.o" ; rm src/function.o ; fi | ||
115 | -if [ -f src/functiontostring.o ] ; then echo " rm: src/functiontostring.o" ; rm src/functiontostring.o ; fi | ||
116 | -if [ -f src/viewer.o ] ; then echo " rm: src/viewer.o" ; rm src/viewer.o ; fi | ||
117 | -if [ -f src/functiondirectoriesin.o ] ; then echo " rm: src/functiondirectoriesin.o" ; rm src/functiondirectoriesin.o ; fi | ||
118 | -if [ -f build ] ; then echo " rm: build" ; rm build ; fi | ||
54 | 119 | ||