tweak C1-era CARR
[openc2e.git] / Makefile.legacy
blobd457922bdb361417c431e662768e2c78fbe973fd
1 .SILENT: user-is-insane
3 default: all
5 user-is-insane:
6         ( \
7                 echo "The Makefile build method is deprecated and intended for use only in"; \
8                 echo "unusual circumstances. To build openc2e:"; \
9                 echo; \
10                 echo "mkdir build; cd build; cmake ..; make"; \
11                 echo; \
12                 exit 1; \
13         ) >&2
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))
25 OPENC2E_CORE = \
26         Agent.o \
27         AgentHelpers.o \
28         AgentRef.o \
29         attFile.o \
30         Backend.o \
31         Blackboard.o \
32         blkImage.o \
33         bmpImage.o \
34         bytecode.o \
35         c16Image.o \
36         c2eBrain.o \
37         CallButton.o \
38         Camera.o \
39         caosScript.o \
40         caosVar.o \
41         caosVM_agent.o \
42         caosVM_camera.o \
43         caosVM_compound.o \
44         caosVM_core.o \
45         caosVM_creatures.o \
46         caosVM_debug.o \
47         caosVM_files.o \
48         caosVM_flow.o \
49         caosVM_genetics.o \
50         caosVM_history.o \
51         caosVM_input.o \
52         caosVM_map.o \
53         caosVM_motion.o \
54         caosVM_net.o \
55         caosVM.o \
56         caosVM_ports.o \
57         caosVM_resources.o \
58         caosVM_scripts.o \
59         caosVM_sounds.o \
60         caosVM_time.o \
61         caosVM_variables.o \
62         caosVM_vectors.o \
63         caosVM_vehicles.o \
64         caosVM_world.o \
65         cataloglexer.o \
66         Catalogue.o \
67         catalogue.tab.o \
68         cmddata.o \
69         cobFile.o \
70         CompoundAgent.o \
71         CompoundPart.o \
72         Creature.o \
73         CreatureAgent.o \
74         creaturesImage.o \
75         dialect.o \
76         Engine.o \
77         exceptions.o \
78         fileSwapper.o \
79         genomeFile.o \
80         historyManager.o \
81         imageManager.o \
82         caoslexer.cpp \
83         Lift.o \
84         Map.o \
85         MetaRoom.o \
86         mmapifstream.o \
87         oldBrain.o \
88         OpenALBackend.o \
89         PathResolver.o \
90         physics.o \
91         PointerAgent.o \
92         pray.o \
93         prayManager.o \
94         renderable.o \
95         Room.o \
96         Scriptorium.o \
97         SDLBackend.o \
98         SFCFile.o \
99         SimpleAgent.o \
100         SkeletalCreature.o \
101         sprImage.o \
102         streamutils.o \
103         Vehicle.o \
104         World.o \
105         util.o
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
122 docs: docs.html
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
151 %.o: %.cpp
152         mkdir -p .deps/`dirname $<` && \
153         $(CXX) $(XCPPFLAGS) -MP -MD -MF .deps/$<.Td -o $@ -c $< && \
154         mv .deps/$<.Td .deps/$<.d
156 %.o: %.c
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 $<
168 openc2e: $(OPENC2E)
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) && \
198         make
200 clean:
201         rm -f *.o openc2e openc2e_s filetests praydumper tools/*.o
202         rm -rf .deps
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
206         rm -f .shake/dump.pl
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
210 test: openc2e 
211         perl runtests.pl
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
217         dot -Tpng -o $@ $^
219 generated: catalogue.tab.hpp cataloglexer.cpp docs.html cmddata.cpp caoslexer.cpp
221 .PHONY: clean all dep docs test default