add support to SDLBackend for rendering 24bit data
[openc2e.git] / Makefile.legacy
blob5f174e6b845f4e929962f4c085b7ab6e2ae1b5e6
1 .SILENT: user-is-insane
3 user-is-insane:
4         ( \
5                 echo "The Makefile build method is deprecated and intended for use only in"; \
6                 echo "unusual circumstances. To build openc2e:"; \
7                 echo; \
8                 echo "mkdir build; cd build; cmake ..; make"; \
9                 echo; \
10                 exit 1; \
11         ) >&2
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))
23 OPENC2E_CORE = \
24         Agent.o \
25         AgentHelpers.o \
26         AgentRef.o \
27         attFile.o \
28         Backend.o \
29         Blackboard.o \
30         blkImage.o \
31         bmpImage.o \
32         bytecode.o \
33         c16Image.o \
34         c2eBrain.o \
35         CallButton.o \
36         Camera.o \
37         caosScript.o \
38         caosVar.o \
39         caosVM_agent.o \
40         caosVM_camera.o \
41         caosVM_compound.o \
42         caosVM_core.o \
43         caosVM_creatures.o \
44         caosVM_debug.o \
45         caosVM_files.o \
46         caosVM_flow.o \
47         caosVM_genetics.o \
48         caosVM_history.o \
49         caosVM_input.o \
50         caosVM_map.o \
51         caosVM_motion.o \
52         caosVM_net.o \
53         caosVM.o \
54         caosVM_ports.o \
55         caosVM_resources.o \
56         caosVM_scripts.o \
57         caosVM_sounds.o \
58         caosVM_time.o \
59         caosVM_variables.o \
60         caosVM_vectors.o \
61         caosVM_vehicles.o \
62         caosVM_world.o \
63         catalogue.lex.o \
64         Catalogue.o \
65         catalogue.tab.o \
66         cmddata.o \
67         cobFile.o \
68         CompoundAgent.o \
69         CompoundPart.o \
70         Creature.o \
71         CreatureAgent.o \
72         creaturesImage.o \
73         dialect.o \
74         Engine.o \
75         exceptions.o \
76         fileSwapper.o \
77         genomeFile.o \
78         historyManager.o \
79         imageManager.o \
80         lex.c2.o \
81         lex.mng.o \
82         lexutil.o \
83         lex.yy.o \
84         Lift.o \
85         Map.o \
86         MetaRoom.o \
87         mmapifstream.o \
88         mngfile.o \
89         mngparser.tab.o \
90         oldBrain.o \
91         OpenALBackend.o \
92         PathResolver.o \
93         physics.o \
94         PointerAgent.o \
95         pray.o \
96         prayManager.o \
97         renderable.o \
98         Room.o \
99         Scriptorium.o \
100         SDLBackend.o \
101         SFCFile.o \
102         SimpleAgent.o \
103         SkeletalCreature.o \
104         sprImage.o \
105         streamutils.o \
106         Vehicle.o \
107         World.o
109 SERIALIZATION = caosVM_ser_real.o
110 SERSTUB = caosVM_ser_stub.o
111 OPENC2E = $(OPENC2E_CORE) $(SERSTUB) main.o
112 OPENC2E_S = $(OPENC2E_CORE) $(SERIALIZATION) main.o
114 DEBUGFLAGS=-ggdb3 -O2
115 CFLAGS += -W -Wall -Wno-conversion -Wno-unused -pthread -D_REENTRANT -DYYERROR_VERBOSE -DOPENAL_SUPPORT
116 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
117 COREFLAGS=$(DEBUGFLAGS) -I/usr/include/SDL -I/usr/include/AL -I.
118 XCFLAGS=$(CFLAGS) $(COREFLAGS)
119 XCPPFLAGS=$(COREFLAGS) $(CPPFLAGS) $(CFLAGS)
121 default: user-is-insane openc2e tools/praydumper docs
122 all: openc2e tools/mngtest tools/filetests tools/praydumper docs tools/pathtest tools/memstats tools/wildtest
124 docs: docs.html
126 commandinfo.yml: $(wildcard caosVM_*.cpp) parsedocs.pl
127         perl parsedocs.pl $(wildcard caosVM_*.cpp) > commandinfo.yml
129 docs.html: writehtml.pl commandinfo.yml
130         perl writehtml.pl commandinfo.yml > docs.html
132 cmddata.cpp: commandinfo.yml writecmds.pl
133         perl writecmds.pl commandinfo.yml > cmddata.cpp
135 lex.mng.cpp lex.mng.h: mng.l
136         flex -+ --prefix=mng -d -o lex.mng.cpp --header-file=lex.mng.h mng.l
138 catalogue.lex.cpp catalogue.lex.h: catalogue.l catalogue.tab.hpp
139         flex -+ --prefix=catalogue -d -o catalogue.lex.cpp --header-file=catalogue.lex.h catalogue.l 
140         
141 mngfile.o: lex.mng.cpp
143 mngparser.tab.cpp mngparser.tab.hpp: mngparser.ypp
144         bison -d --name-prefix=mng mngparser.ypp
146 catalogue.tab.cpp catalogue.tab.hpp: catalogue.ypp
147         bison -d --name-prefix=cata catalogue.ypp
149 lex.yy.cpp lex.yy.h: caos.l
150         flex -+ -d -o lex.yy.cpp --header-file=lex.yy.h --prefix=c2e caos.l
152 lex.c2.cpp lex.c2.h: c2caos.l
153         flex -+ -d -o lex.c2.cpp --header-file=lex.c2.h --prefix=c2 c2caos.l
155 ## lex.yy.h deps aren't detected evidently
156 caosScript.o: lex.yy.h lex.yy.cpp lex.c2.h lex.c2.cpp
158 ## based on automake stuff
159 %.o: %.cpp
160         mkdir -p .deps/`dirname $<` && \
161         $(CXX) $(XCPPFLAGS) -MP -MD -MF .deps/$<.Td -o $@ -c $< && \
162         mv .deps/$<.Td .deps/$<.d
164 %.o: %.c
165         mkdir -p .deps/`dirname $<` && \
166         $(CC) $(XCFLAGS) -MP -MD -MF .deps/$<.Td -o $@ -c $< && \
167         mv .deps/$<.Td .deps/$<.d
169 include $(shell find .deps -name '*.d' -type f 2>/dev/null || true)
170 Catalogue.o: catalogue.lex.h catalogue.tab.hpp
171 lex.mng.o: mngparser.tab.hpp
173 Creature_standalone.o: Creature.cpp Creature.o
174         $(CC) $(XCFLAGS) -D_CREATURE_STANDALONE -o $@ -c $<
176 openc2e: $(OPENC2E)
177         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
179 openc2e_s: $(OPENC2E_S)
180         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
182 tools/filetests: tools/filetests.o genomeFile.o streamutils.o Catalogue.o catalogue.lex.o catalogue.tab.o
183         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
185 tools/praydumper: tools/praydumper.o pray.o
186         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
188 tools/mngtest: tools/mngtest.o mngfile.o mngparser.tab.o lex.mng.o
189         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
191 tools/pathtest: tools/pathtest.o PathResolver.o
192         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
194 tools/wildtest: tools/wildtest.o PathResolver.o
195         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
197 tools/memstats: tools/memstats.o $(OPENC2E_CORE) $(SERSTUB)
198         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
200 tools/serialtest: tools/serialtest.o $(OPENC2E_CORE) $(SERIALIZATION)
201         $(CXX) -o $@ $^ $(XLDFLAGS) $(XCXXFLAGS)
203 tools/braininavat/braininavat: Creature_standalone.o c2eBrain.o streamutils.o genomeFile.o
204         cd tools/braininavat && \
205         (qmake-qt4 || qmake) && \
206         make
208 clean:
209         rm -f *.o openc2e openc2e_s filetests praydumper tools/*.o
210         rm -rf .deps
211         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
212         rm -f tools/filetests tools/memstats tools/mngtest tools/pathtest tools/praydumper tools/serialtest
213         rm -f headerdeps.dot headerdeps.png
214         rm -f .shake/dump.pl
215         rm -f tools/braininavat/Makefile tools/braininavat/*.o tools/braininavat/moc_*.cpp tools/braininavat/braininavat
216         rm -f catalogue.lex.cpp catalogue.lex.h catalogue.tab.cpp catalogue.tab.hpp docs.html
218 test: openc2e 
219         perl runtests.pl
221 headerdeps.dot: $(wildcard *.h) $(wildcard *.hpp) $(wildcard ser/*.h) mngparser.tab.hpp catalogue.tab.hpp lex.mng.h lex.yy.h catalogue.lex.h
222         tools/depgraph.sh $^ > $@
224 headerdeps.png: headerdeps.dot
225         dot -Tpng -o $@ $^
227 generated: catalogue.tab.hpp lex.yy.h lex.c2.h mngparser.tab.hpp catalogue.lex.h lex.mng.h docs.html cmddata.cpp
229 .PHONY: clean all dep docs test