1 .SILENT: user-is-insane
7 echo "The Makefile build method is deprecated and intended for use only in"; \
8 echo "unusual circumstances. To build openc2e:"; \
10 echo "mkdir build; cd build; cmake ..; make"; \
15 CXXFILES = $(wildcard *.cpp) $(wildcard tools/*.cpp)
16 CFILES = $(wildcard *.c) $(wildcard tools/*.c)
18 SOURCES = $(CXXFILES) $(CFILES)
19 HEADERS = $(wildcard *.h)
20 EVERYTHING = $(SOURCES) $(HEADERS)
22 SOURCEDEPS = $(patsubst %.cpp,.deps/%.dpp,$(CXXFILES)) \
23 $(patsubst %.c,.deps/%.d,$(CFILES))
107 SERIALIZATION = caosVM_ser_real.o
108 SERSTUB = caosVM_ser_stub.o
109 OPENC2E = $(OPENC2E_CORE) $(SERSTUB) main.o
110 OPENC2E_S = $(OPENC2E_CORE) $(SERIALIZATION) main.o
112 DEBUGFLAGS=-ggdb3 -O2
113 CFLAGS += -W -Wall -Wno-conversion -Wno-unused -pthread -D_REENTRANT -DYYERROR_VERBOSE -DOPENAL_SUPPORT
114 XLDFLAGS=$(LDFLAGS) -lboost_program_options-mt -lboost_serialization-mt -lboost_filesystem-mt -lboost_thread-mt -lSDL -lz -lm -lSDL_net -lSDL_gfx -lpthread -lopenal -lalut -lboost_regex-mt
115 COREFLAGS=$(DEBUGFLAGS) -I/usr/include/SDL -I/usr/include/AL -I.
116 XCFLAGS=$(CFLAGS) $(COREFLAGS)
117 XCPPFLAGS=$(COREFLAGS) $(CPPFLAGS) $(CFLAGS)
119 default: user-is-insane openc2e tools/praydumper docs
120 all: openc2e tools/filetests tools/praydumper docs tools/pathtest tools/memstats tools/wildtest
124 commandinfo.yml: $(wildcard caosVM_*.cpp) parsedocs.pl
125 perl parsedocs.pl $(wildcard caosVM_*.cpp) > commandinfo.yml
127 docs.html: writehtml.pl commandinfo.yml
128 perl writehtml.pl commandinfo.yml > docs.html
130 cmddata.cpp: commandinfo.yml writecmds.pl
131 perl writecmds.pl commandinfo.yml > cmddata.cpp
133 #lex.mng.cpp lex.mng.h: mng.l
134 # flex -+ --prefix=mng -d -o lex.mng.cpp --header-file=lex.mng.h mng.l
136 cataloglexer.cpp: cataloglexer.re2c
137 re2c -o cataloglexer.cpp cataloglexer.re2c
139 caoslexer.cpp: caoslexer.re2c
140 re2c -o caoslexer.cpp caoslexer.re2c
142 mngfile.o: lex.mng.cpp
144 #mngparser.tab.cpp mngparser.tab.hpp: mngparser.ypp
145 # bison -d --name-prefix=mng mngparser.ypp
147 catalogue.tab.cpp catalogue.tab.hpp: catalogue.ypp
148 bison -d --name-prefix=cata catalogue.ypp
150 ## based on automake stuff
152 mkdir -p .deps/`dirname $<` && \
153 $(CXX) $(XCPPFLAGS) -MP -MD -MF .deps/$<.Td -o $@ -c $< && \
154 mv .deps/$<.Td .deps/$<.d
157 mkdir -p .deps/`dirname $<` && \
158 $(CC) $(XCFLAGS) -MP -MD -MF .deps/$<.Td -o $@ -c $< && \
159 mv .deps/$<.Td .deps/$<.d
161 include $(shell find .deps -name '*.d' -type f 2>/dev/null || true)
162 Catalogue.o: catalogue.tab.hpp
163 lex.mng.o: mngparser.tab.hpp
165 Creature_standalone.o: Creature.cpp Creature.o
166 $(CC) $(XCFLAGS) -D_CREATURE_STANDALONE -o $@ -c $<
169 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
171 openc2e_s: $(OPENC2E_S)
172 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
174 tools/filetests: tools/filetests.o genomeFile.o streamutils.o Catalogue.o catalogue.tab.o util.o cataloglexer.o
175 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
177 tools/praydumper: tools/praydumper.o pray.o
178 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
180 #tools/mngtest: tools/mngtest.o mngfile.o mngparser.tab.o lex.mng.o
181 # $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
183 tools/pathtest: tools/pathtest.o PathResolver.o
184 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
186 tools/wildtest: tools/wildtest.o PathResolver.o
187 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
189 tools/memstats: tools/memstats.o $(OPENC2E_CORE) $(SERSTUB)
190 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
192 tools/serialtest: tools/serialtest.o $(OPENC2E_CORE) $(SERIALIZATION)
193 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
195 tools/braininavat/braininavat: Creature_standalone.o c2eBrain.o streamutils.o genomeFile.o
196 cd tools/braininavat && \
197 (qmake-qt4 || qmake) && \
201 rm -f *.o openc2e openc2e_s filetests praydumper tools/*.o
203 rm -f commandinfo.yml lex.yy.cpp lex.yy.h lex.c2.cpp lex.c2.h lex.mng.cpp lex.mng.h mngparser.tab.cpp mngparser.tab.hpp cmddata.cpp
204 rm -f tools/filetests tools/memstats tools/mngtest tools/pathtest tools/praydumper tools/serialtest
205 rm -f headerdeps.dot headerdeps.png
207 rm -f tools/braininavat/Makefile tools/braininavat/*.o tools/braininavat/moc_*.cpp tools/braininavat/braininavat
208 rm -f cataloglexer.cpp caoslexer.cpp catalogue.lex.h catalogue.tab.cpp catalogue.tab.hpp docs.html
213 headerdeps.dot: $(wildcard *.h) $(wildcard *.hpp) $(wildcard ser/*.h) mngparser.tab.hpp catalogue.tab.hpp lex.mng.h lex.yy.h catalogue.lex.h
214 tools/depgraph.sh $^ > $@
216 headerdeps.png: headerdeps.dot
219 generated: catalogue.tab.hpp cataloglexer.cpp docs.html cmddata.cpp caoslexer.cpp
221 .PHONY: clean all dep docs test default