1 .SILENT: user-is-insane
5 echo "The Makefile build method is deprecated and intended for use only in"; \
6 echo "unusual circumstances. To build openc2e:"; \
8 echo "mkdir build; cd build; cmake ..; make"; \
13 CXXFILES = $(wildcard *.cpp) $(wildcard tools/*.cpp)
14 CFILES = $(wildcard *.c) $(wildcard tools/*.c)
16 SOURCES = $(CXXFILES) $(CFILES)
17 HEADERS = $(wildcard *.h)
18 EVERYTHING = $(SOURCES) $(HEADERS)
20 SOURCEDEPS = $(patsubst %.cpp,.deps/%.dpp,$(CXXFILES)) \
21 $(patsubst %.c,.deps/%.d,$(CFILES))
105 SERIALIZATION = caosVM_ser_real.o
106 SERSTUB = caosVM_ser_stub.o
107 OPENC2E = $(OPENC2E_CORE) $(SERSTUB) main.o
108 OPENC2E_S = $(OPENC2E_CORE) $(SERIALIZATION) main.o
110 DEBUGFLAGS=-ggdb3 -O2
111 CFLAGS += -W -Wall -Wno-conversion -Wno-unused -pthread -D_REENTRANT -DYYERROR_VERBOSE -DOPENAL_SUPPORT
112 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
113 COREFLAGS=$(DEBUGFLAGS) -I/usr/include/SDL -I/usr/include/AL -I.
114 XCFLAGS=$(CFLAGS) $(COREFLAGS)
115 XCPPFLAGS=$(COREFLAGS) $(CPPFLAGS) $(CFLAGS)
117 default: user-is-insane openc2e tools/praydumper docs
118 all: openc2e tools/filetests tools/praydumper docs tools/pathtest tools/memstats tools/wildtest
122 commandinfo.yml: $(wildcard caosVM_*.cpp) parsedocs.pl
123 perl parsedocs.pl $(wildcard caosVM_*.cpp) > commandinfo.yml
125 docs.html: writehtml.pl commandinfo.yml
126 perl writehtml.pl commandinfo.yml > docs.html
128 cmddata.cpp: commandinfo.yml writecmds.pl
129 perl writecmds.pl commandinfo.yml > cmddata.cpp
131 #lex.mng.cpp lex.mng.h: mng.l
132 # flex -+ --prefix=mng -d -o lex.mng.cpp --header-file=lex.mng.h mng.l
134 cataloglexer.cpp: cataloglexer.re2c
135 re2c -o cataloglexer.cpp cataloglexer.re2c
137 caoslexer.cpp: caoslexer.re2c
138 re2c -o caoslexer.cpp caoslexer.re2c
140 mngfile.o: lex.mng.cpp
142 #mngparser.tab.cpp mngparser.tab.hpp: mngparser.ypp
143 # bison -d --name-prefix=mng mngparser.ypp
145 catalogue.tab.cpp catalogue.tab.hpp: catalogue.ypp
146 bison -d --name-prefix=cata catalogue.ypp
148 ## based on automake stuff
150 mkdir -p .deps/`dirname $<` && \
151 $(CXX) $(XCPPFLAGS) -MP -MD -MF .deps/$<.Td -o $@ -c $< && \
152 mv .deps/$<.Td .deps/$<.d
155 mkdir -p .deps/`dirname $<` && \
156 $(CC) $(XCFLAGS) -MP -MD -MF .deps/$<.Td -o $@ -c $< && \
157 mv .deps/$<.Td .deps/$<.d
159 include $(shell find .deps -name '*.d' -type f 2>/dev/null || true)
160 Catalogue.o: catalogue.tab.hpp
161 lex.mng.o: mngparser.tab.hpp
163 Creature_standalone.o: Creature.cpp Creature.o
164 $(CC) $(XCFLAGS) -D_CREATURE_STANDALONE -o $@ -c $<
167 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
169 openc2e_s: $(OPENC2E_S)
170 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
172 tools/filetests: tools/filetests.o genomeFile.o streamutils.o Catalogue.o catalogue.tab.o util.o cataloglexer.o
173 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
175 tools/praydumper: tools/praydumper.o pray.o
176 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
178 #tools/mngtest: tools/mngtest.o mngfile.o mngparser.tab.o lex.mng.o
179 # $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
181 tools/pathtest: tools/pathtest.o PathResolver.o
182 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
184 tools/wildtest: tools/wildtest.o PathResolver.o
185 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
187 tools/memstats: tools/memstats.o $(OPENC2E_CORE) $(SERSTUB)
188 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
190 tools/serialtest: tools/serialtest.o $(OPENC2E_CORE) $(SERIALIZATION)
191 $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
193 tools/braininavat/braininavat: Creature_standalone.o c2eBrain.o streamutils.o genomeFile.o
194 cd tools/braininavat && \
195 (qmake-qt4 || qmake) && \
199 rm -f *.o openc2e openc2e_s filetests praydumper tools/*.o
201 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
202 rm -f tools/filetests tools/memstats tools/mngtest tools/pathtest tools/praydumper tools/serialtest
203 rm -f headerdeps.dot headerdeps.png
205 rm -f tools/braininavat/Makefile tools/braininavat/*.o tools/braininavat/moc_*.cpp tools/braininavat/braininavat
206 rm -f cataloglexer.cpp caoslexer.cpp catalogue.lex.h catalogue.tab.cpp catalogue.tab.hpp docs.html
211 headerdeps.dot: $(wildcard *.h) $(wildcard *.hpp) $(wildcard ser/*.h) mngparser.tab.hpp catalogue.tab.hpp lex.mng.h lex.yy.h catalogue.lex.h
212 tools/depgraph.sh $^ > $@
214 headerdeps.png: headerdeps.dot
217 generated: catalogue.tab.hpp cataloglexer.cpp docs.html cmddata.cpp caoslexer.cpp
219 .PHONY: clean all dep docs test