Open Source Tomb Raider Engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  1. ###############################################################
  2. # Mongoose <stu7440@westga.edu>
  3. ###############################################################
  4. # + Cleaner clean
  5. # + Add new include tree
  6. # + Add new flags
  7. # + Install/Uninstall
  8. # + Debian and Redhat packaging
  9. # + Lots of misc new features
  10. ###############################################################
  11. BUILD_SELECT=debug
  12. NAME=OpenRaider
  13. NAME_DEB=openraider
  14. MAJOR_VERSION=0
  15. MINOR_VERSION=1
  16. MICRO_VERSION=2
  17. BUILD_ID=20140102
  18. PRE=
  19. VERSION=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)$(PRE)
  20. VERSION_DEB=$(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION).$(BUILD_ID)
  21. BUILD_HOST=$(shell uname -s -n -r -m)
  22. ARCH=$(shell uname -m)
  23. #ARCH=i386
  24. UNAME=$(shell uname -s)
  25. ###############################################################
  26. # -DUSING_OPENAL Add OpenAL sound support
  27. # -DMULTITEXTURE Add OpenGL multitexturing
  28. # -DUNICODE_SUPPORT Add unicode/internation keyboard support
  29. # -DUSING_EMITTER_IN_GAME Run particle test in game
  30. BASE_DEFS=$(shell sdl-config --cflags) -Isrc -I/opt/local/include -DSDL_INTERFACE \
  31. -DUSING_OPENGL -DZLIB_SUPPORT -DUSING_EMITTER \
  32. -DUSING_OPENAL -DUSING_MTK_TGA -DUSING_PTHREADS \
  33. -DUSING_HEL -DHAVE_SDL_TTF -DHAVE_OPENGL
  34. BASE_LIBS=$(shell sdl-config --libs) -lz -lstdc++ \
  35. -lpthread -lSDL_ttf
  36. # -DDEBUG_GL
  37. DEBUG_DEFS=-DDEBUG -DEXPERIMENTAL
  38. DEBUG_OBJ=
  39. ###############################################################
  40. # OpenAL, Sound support
  41. BASE_DEFS += -DHAVE_OPENAL
  42. ifeq ($(UNAME),Darwin)
  43. AUDIO_LIBS += -lalut
  44. AUDIO_LIBS += -L/opt/local/lib
  45. AUDIO_LIBS += -I/opt/local/include
  46. AUDIO_LIBS += -framework OpenAL
  47. BASE_LIBS += -framework OpenGL
  48. BASE_LIBS += -framework GLUT
  49. else
  50. AUDIO_LIBS += -lopenal
  51. endif
  52. BASE_LIBS += $(AUDIO_LIBS)
  53. # libferit, File transfer via HTTP/FTP/etc support
  54. LIBFERIT_LIB=/usr/local/lib/libferit.so
  55. LIBFERIT=$(shell if test -e $(LIBFERIT_LIB) > /dev/null; then echo yes; fi)
  56. ifeq ($(LIBFERIT), yes)
  57. BASE_DEFS += -DHAVE_LIBFERIT
  58. BASE_LIBS += -lferit
  59. endif
  60. ###############################################################
  61. TREE_DIR=OpenRaider
  62. BUILD_DEBUG_DIR=bin/debug
  63. BUILD_RELEASE_DIR=bin/release
  64. BUILD_PROF_DIR=bin/prof
  65. BUILD_TEST_DIR=bin/test
  66. BUILD_MEM_DIR=bin/mem
  67. BUILD_INSTALL_DIR=bin/$(BUILD_SELECT)
  68. DEB_DIR=/tmp/$(NAME).deb
  69. # Edited for Debian GNU/Linux.
  70. DESTDIR =
  71. INSTALL_BIN=$(DESTDIR)/usr/games
  72. INSTALL_LIB=$(DESTDIR)/usr/lib
  73. INSTALL_DOC=$(DESTDIR)/usr/share/doc/$(NAME)
  74. INSTALL_SHARE=$(DESTDIR)/usr/share/$(NAME)
  75. INSTALL_INCLUDE=$(DESTDIR)/usr/include
  76. ###############################################################
  77. CC=gcc
  78. BASE_CFLAGS=-Wall $(BASE_DEFS) \
  79. -DVERSION=\"\\\"$(NAME)-$(VERSION)-$(BUILD_ID)\\\"\" \
  80. -DBUILD_HOST=\"\\\"$(BUILD_HOST)\\\"\"
  81. LD_FLAGS=-L/usr/X11/lib -lXmu -lXt -lSM -lICE -lXext -lX11 -lXi \
  82. -lm $(BASE_LIBS)
  83. ifneq ($(UNAME),Darwin)
  84. LD_FLAGS+=-lGL -lGLU
  85. endif
  86. RELEASE_CFLAGS=$(BASE_CFLAGS) -ffast-math -funroll-loops \
  87. -fomit-frame-pointer -O2
  88. DEBUG_CFLAGS=$(BASE_CFLAGS) -g -O0 $(DEBUG_DEFS)
  89. ################################################################
  90. DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
  91. DO_SHLIB_CC=$(CC) $(CFLAGS) $(SHLIBCFLAGS) -o $@ -c $<
  92. TARGETS=$(BUILDDIR)/$(NAME)
  93. ################################################################
  94. auto: $(BUILD_SELECT)
  95. run: $(BUILD_SELECT)
  96. bin/$(BUILD_SELECT)/OpenRaider
  97. targets: $(TARGETS)
  98. bundle: release
  99. mac_dist/bundle.sh
  100. mac_dist/plist.sh $(NAME) $(VERSION) $(BUILD_ID) > bin/OpenRaider.app/Contents/Info.plist
  101. mac_dist/frameworks.sh
  102. bundle-image: bundle
  103. mac_dist/image.sh
  104. bundle-archive: bundle
  105. mac_dist/archive.sh
  106. all: debug release prof
  107. debug:
  108. @-mkdir -p $(BUILD_DEBUG_DIR)
  109. $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) \
  110. CFLAGS="$(DEBUG_CFLAGS)" \
  111. LD_FLAGS="$(LD_FLAGS)"
  112. prof:
  113. @-mkdir -p $(BUILD_PROF_DIR)
  114. $(MAKE) targets BUILDDIR=$(BUILD_PROF_DIR) \
  115. CFLAGS="$(DEBUG_CFLAGS) -pg" \
  116. LD_FLAGS="$(LD_FLAGS) -pg"
  117. release:
  118. @-mkdir -p $(BUILD_RELEASE_DIR)
  119. $(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) \
  120. CFLAGS="$(RELEASE_CFLAGS)" \
  121. LD_FLAGS="$(LD_FLAGS)"
  122. #####################################
  123. ded:
  124. @-mkdir -p $(BUILD_DEBUG_DIR)/ded
  125. $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR)/ded \
  126. CFLAGS="$(DEBUG_CFLAGS) -DDEDICATED_SERVER" \
  127. LD_FLAGS="$(LD_FLAGS)"
  128. md3:
  129. @-mkdir -p $(BUILD_DEBUG_DIR)
  130. $(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) \
  131. DEBUG_OBJ="$(BUILD_DEBUG_DIR)/endian.o $(BUILD_DEBUG_DIR)/Md3.o $(BUILD_DEBUG_DIR)/Md3AnimModel.o" \
  132. CFLAGS="$(DEBUG_CFLAGS) -DUSING_MD3" \
  133. LD_FLAGS="$(LD_FLAGS)"
  134. # -DDEBUG_MEMEORY_VERBOSE
  135. # -DDEBUG_MEMEORY
  136. memory:
  137. @-mkdir -p $(BUILD_MEM_DIR)
  138. $(MAKE) targets BUILDDIR=$(BUILD_MEM_DIR) \
  139. DEBUG_OBJ="$(BUILD_MEM_DIR)/memeory_test.o" \
  140. CFLAGS="$(DEBUG_CFLAGS) -DDEBUG_MEMEORY" \
  141. LD_FLAGS="$(LD_FLAGS)"
  142. depend:
  143. @-echo "Making deps..."
  144. @-echo "# Autogenerated dependency file" > depend
  145. @-find ./src -name "*.cpp" -exec ./deps.sh $(BASE_DEFS) {} \; >> depend
  146. @-echo "[DONE]"
  147. ################################################################
  148. # Later hel will become a seperate library once it matures
  149. HEL_OBJ = \
  150. $(BUILDDIR)/Mass.o \
  151. $(BUILDDIR)/Simulation.o \
  152. $(BUILDDIR)/Vector3d.o \
  153. $(BUILDDIR)/Matrix.o \
  154. $(BUILDDIR)/ViewVolume.o \
  155. $(BUILDDIR)/CollisionObject.o \
  156. $(BUILDDIR)/BoundingVolume.o \
  157. $(BUILDDIR)/Quaternion.o \
  158. $(BUILDDIR)/math.o \
  159. $(BUILDDIR)/Entity.o
  160. #$(BUILDDIR)/Spring.o
  161. OBJS = \
  162. $(DEBUG_OBJ) \
  163. $(HEL_OBJ) \
  164. $(BUILDDIR)/mtk_tga.o \
  165. $(BUILDDIR)/System.o \
  166. $(BUILDDIR)/SDLSystem.o \
  167. $(BUILDDIR)/OpenRaider.o \
  168. $(BUILDDIR)/World.o \
  169. $(BUILDDIR)/TombRaider.o \
  170. $(BUILDDIR)/GLString.o \
  171. $(BUILDDIR)/Camera.o \
  172. $(BUILDDIR)/OpenGLMesh.o \
  173. $(BUILDDIR)/Render.o \
  174. $(BUILDDIR)/Sound.o \
  175. $(BUILDDIR)/Network.o \
  176. $(BUILDDIR)/Texture.o \
  177. $(BUILDDIR)/Emitter.o \
  178. $(BUILDDIR)/Particle.o \
  179. $(BUILDDIR)/SkeletalModel.o \
  180. $(BUILDDIR)/Light.o
  181. $(BUILDDIR)/$(NAME) : $(OBJS)
  182. $(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $(OBJS)
  183. ifeq ($(UNAME),Darwin)
  184. install_name_tool -change libalut.0.1.0.dylib /opt/local/lib/libalut.0.1.0.dylib $@
  185. endif
  186. #################################################################
  187. clean: clean-small clean-dep
  188. clean-small: clean-emacs clean-build clean-test clean-obj
  189. @-rm -rf bin/OpenRaider.app
  190. @-rm -rf bin/OpenRaider.dmg
  191. @-rm -rf bin/OpenRaider.zip
  192. clean-dep:
  193. @-echo "Cleaning dependencies "
  194. @-rm -f depend
  195. @-echo "[DONE]"
  196. clean-test:
  197. @-echo "Cleaning test builds "
  198. @-rm -f $(BUILD_TEST_DIR)/*.o
  199. @-rm -f $(BUILD_TEST_DIR)/*.test
  200. @-rm -rf $(BUILD_TEST_DIR)/*.build
  201. @-echo "[DONE]"
  202. clean-obj:
  203. @-echo "Cleaning objects "
  204. @-rm -f $(BUILD_PROF_DIR)/*.o
  205. @-rm -f $(BUILD_DEBUG_DIR)/*.o
  206. @-rm -f $(BUILD_RELEASE_DIR)/*.o
  207. @-rm -f $(BUILD_TEST_DIR)/*.o
  208. @-rm -f $(BUILD_MEM_DIR)/*.o
  209. @-echo "[DONE]"
  210. clean-emacs:
  211. @-echo "Cleaning emacs files "
  212. @-rm -f `find . -name "*~" -print`
  213. @-echo "[DONE]"
  214. clean-build:
  215. @-echo "Cleaning builds "
  216. @-rm -f $(BUILD_PROF_DIR)/$(NAME)
  217. @-rm -f $(BUILD_DEBUG_DIR)/$(NAME)
  218. @-rm -f $(BUILD_RELEASE_DIR)/$(NAME)
  219. @-rm -f $(BUILD_MEM_DIR)/$(NAME)
  220. @-echo "[DONE]"
  221. clean-deb:
  222. @-echo "Cleaning DEBs "
  223. @-rm -rf $(DEB_DIR)
  224. @-echo "[DONE]"
  225. #################################################################
  226. -include depend
  227. #################################################################
  228. redhat:
  229. cd $(DEB_DIR) && \
  230. alien --to-rpm $(NAME_DEB)_$(VERSION_DEB)-1_$(ARCH).deb
  231. debian:
  232. $(MAKE) tarball
  233. $(MAKE) clean-deb
  234. mkdir -p $(DEB_DIR)
  235. cp ../$(NAME_DEB)-$(VERSION_DEB).tar.gz $(DEB_DIR)
  236. cd $(DEB_DIR) && tar zxvf $(NAME_DEB)-$(VERSION_DEB).tar.gz && mv $(TREE_DIR) $(NAME_DEB)-$(VERSION_DEB) && cd $(NAME_DEB)-$(VERSION_DEB) && make deb-init && make deb
  237. deb-init:
  238. dh_make -c gpl -s \
  239. -e mongoose@icculus.org -f ../$(NAME_DEB)-$(VERSION_DEB).tar.gz
  240. @-cp debian/control debian/control.old
  241. @-sed -e "s/<insert up to 60 chars description>/Open source Tomb Raider series clone/g" debian/control.old > debian/control
  242. @-rm -f debian/control.old
  243. @-cp debian/control debian/control.old
  244. @-sed -e "s/<insert long description, indented with spaces>/OpenRaider is an open source multiplayer and single player Tomb Raider clone for linux and Playstation 2. It uses the game data such as models, sound, levels, and animation from the popular 3d series Tomb Raider by Core Design./g" debian/control.old > debian/control
  245. @-rm -f debian/control.old
  246. deb:
  247. dpkg-buildpackage -rfakeroot
  248. apt:
  249. cd $(DEB_DIR) && dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
  250. cd $(DEB_DIR) && dpkg-scansources . /dev/null | gzip -9c > Sources.gz
  251. apt-upload:
  252. scp $(DEB_DIR)/Packages.gz \
  253. $(DEB_DIR)/Sources.gz \
  254. $(DEB_DIR)/$(NAME_DEB)*.diff.gz \
  255. $(DEB_DIR)/$(NAME_DEB)*.deb \
  256. $(DEB_DIR)/$(NAME_DEB)*.dsc \
  257. $(DEB_DIR)/$(NAME_DEB)*.orig.tar.gz \
  258. orbital.sf.net:~/openraider/htdocs/debian/
  259. install:
  260. mkdir -p $(INSTALL_SHARE)/data
  261. cp setup.sh $(INSTALL_SHARE)
  262. cp data/* $(INSTALL_SHARE)/data
  263. mkdir -p $(INSTALL_DOC)
  264. cp README ChangeLog BUGS TODO $(INSTALL_DOC)
  265. mkdir -p $(INSTALL_BIN)
  266. cp bin/$(BUILD_SELECT)/OpenRaider $(INSTALL_BIN)
  267. bin-tarball:
  268. $(MAKE) clean-obj
  269. @-cd .. && tar zcvf $(NAME_DEB)-$(VERSION_DEB)-$(ARCH).tar.gz \
  270. $(TREE_DIR)/Makefile $(TREE_DIR)/data \
  271. $(TREE_DIR)/bin/$(BUILD_SELECT)/OpenRaider \
  272. $(TREE_DIR)/README $(TREE_DIR)/ChangeLog \
  273. $(TREE_DIR)/BUGS $(TREE_DIR)/TODO
  274. tarball:
  275. @-echo "Making tarball "
  276. @-cd .. && tar zcvf $(NAME_DEB)-$(VERSION_DEB).tar.gz \
  277. $(TREE_DIR) --exclude old --exclude models \
  278. --exclude semantic.cache --exclude TAGS \
  279. --exclude bin --exclude CVS --exclude *~
  280. @-echo "[DONE]"
  281. PSKModel.zip:
  282. @-echo "Making PSKModel pak "
  283. @-zip ../pskmodel-$(BUILD_ID)-src.zip \
  284. Makefile deps.sh README.PSKModel \
  285. src/PSKModel.h src/PSKModel.cpp \
  286. src/UTPackage.h src/UTPackage.cpp \
  287. src/Texture.h src/Texture.cpp \
  288. src/mtk_tga.cpp src/mtk_tga.h
  289. @-echo "[DONE]"
  290. @-echo "Making test data pak "
  291. @-zip -r ../pskmodel-$(BUILD_ID)-data.zip \
  292. data/models/test/
  293. @-echo "[DONE]"
  294. backup:
  295. $(MAKE) tarball
  296. @-cd .. && cp $(NAME)-$(VERSION)-$(BUILD_ID).tar.gz ~/Backup
  297. #################################################################
  298. # Unit Test builds
  299. #################################################################
  300. TEST_FLAGS=-Wall -g -O0 -DDEBUG -lstdc++
  301. TEST_MAP_TR5=~/projects/Data/models/tombraider/tr5/demo.trc
  302. TEST_MAP_TR4=~/projects/Data/models/tombraider/tr4/angkor1.tr4
  303. TEST_MAP_TR3=~/projects/Data/models/tombraider/tr3/scotland.tr2
  304. TEST_MAP_TR2=~/projects/Data/models/tombraider/tr2/unwater.tr2
  305. TEST_MAP_TR1=~/projects/Data/models/tombraider/tr1/level1.phd
  306. TombRaider.reg_test:
  307. $(MAKE) TombRaider.test
  308. $(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR1) > /tmp/log.tr1
  309. $(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR2) > /tmp/log.tr2
  310. $(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR3) > /tmp/log.tr3
  311. $(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR4) > /tmp/log.tr4
  312. $(BUILD_TEST_DIR)/TombRaider.test load $(TEST_MAP_TR5) > /tmp/log.tr5
  313. TombRaider.test:
  314. @-mkdir -p $(BUILD_TEST_DIR)
  315. $(MAKE) targets NAME=TombRaider.test BUILDDIR=$(BUILD_TEST_DIR) \
  316. OBJS="$(BUILD_TEST_DIR)/TombRaider.o $(BUILD_TEST_DIR)/mtk_tga.o $(BUILD_TEST_DIR)/memeory_test.o" \
  317. CFLAGS="$(BASE_CFLAGS) -g -D__TOMBRAIDER_TEST__ -D__TEST_TR5_DUMP_TGA -D__TEST_32BIT_TEXTILES -DDEBUG_MEMEORY" \
  318. LD_FLAGS="-lz"
  319. #################################################################
  320. MD3ANIMMODEL_CFLAGS=-DUSING_OPENGL -DUNIT_TEST_MD3ANIMMODEL_SDL \
  321. -DUSING_MTK_TGA -DUSING_HEL $(shell sdl-config --cflags) \
  322. -DHAVE_SDL_TTF
  323. MD3ANIMMODEL_LDFLAGS=-lm -lstdc++ -lGL -lGLU $(shell sdl-config --libs) \
  324. -lSDL_ttf
  325. MD3ANIMMODEL_OBJS=$(BUILD_TEST_DIR)/mtk_tga.o \
  326. $(BUILD_TEST_DIR)/Texture.o $(BUILD_TEST_DIR)/endian.o \
  327. $(BUILD_TEST_DIR)/Quaternion.o \
  328. $(BUILD_TEST_DIR)/Md3.o $(BUILD_TEST_DIR)/Md3AnimModel.o
  329. Md3AnimModel.test:
  330. mkdir -p $(BUILD_TEST_DIR)
  331. $(MAKE) targets \
  332. NAME=Md3AnimModel.test \
  333. BUILDDIR=$(BUILD_TEST_DIR) \
  334. OBJS="$(MD3ANIMMODEL_OBJS)" \
  335. CFLAGS=" -Wall -O0 -g -Isrc $(MD3ANIMMODEL_CFLAGS)" \
  336. LD_FLAGS="$(MD3ANIMMODEL_LDFLAGS)"
  337. #################################################################
  338. GLString.test:
  339. mkdir -p $(BUILD_TEST_DIR)
  340. $(CC) -Wall -Isrc -D__TEST__ -DHAVE_MTK -DHAVE_SDL -DUSING_MTK_TGA \
  341. $(shell sdl-config --cflags) $(shell sdl-config --libs) \
  342. -lGL -lGLU -lm \
  343. src/Texture.cpp src/mtk_tga.cpp \
  344. src/GLString.cpp -o $(BUILD_TEST_DIR)/GLString.test
  345. #################################################################
  346. SIMULATION_CFLAGS=-Wall -O0 -g -Isrc $(shell sdl-config --cflags) \
  347. -DUSING_OPENGL -DUSING_HEL -DUSING_MTK_TGA \
  348. -DUNIT_TEST_SIMULATION
  349. SIMULATION_OBJS=$(BUILD_TEST_DIR)/mtk_tga.o $(BUILD_TEST_DIR)/Texture.o \
  350. $(BUILD_TEST_DIR)/Mass.o \
  351. $(BUILD_TEST_DIR)/CollisionObject.o \
  352. $(BUILD_TEST_DIR)/Simulation.o \
  353. $(BUILD_TEST_DIR)/Vector3d.o \
  354. $(BUILD_TEST_DIR)/Matrix.o \
  355. $(BUILD_TEST_DIR)/ViewVolume.o \
  356. $(BUILD_TEST_DIR)/BoundingVolume.o \
  357. $(BUILD_TEST_DIR)/Quaternion.o \
  358. $(BUILD_TEST_DIR)/math.o
  359. Simulation.test:
  360. mkdir -p $(BUILD_TEST_DIR)
  361. $(MAKE) targets NAME=Simulation.test BUILDDIR=$(BUILD_TEST_DIR) \
  362. OBJS="$(SIMULATION_OBJS)" \
  363. CFLAGS="$(SIMULATION_CFLAGS)" \
  364. LD_FLAGS="-lm -lstdc++ -lGL -lGLU $(shell sdl-config --libs)"
  365. #################################################################
  366. HEL_PARTICLE_CFLAGS=-Wall -O0 -g -Isrc $(shell sdl-config --cflags) \
  367. -DUSING_OPENGL -DUSING_HEL -DUSING_MTK_TGA \
  368. -DUNIT_TEST_SPRING -DHAVE_SDL_TTF -lSDL_ttf
  369. HEL_PARTICLE_OBJS=$(BUILD_TEST_DIR)/mtk_tga.o $(BUILD_TEST_DIR)/Texture.o \
  370. $(BUILD_TEST_DIR)/Mass.o \
  371. $(BUILD_TEST_DIR)/Spring.o \
  372. $(BUILD_TEST_DIR)/CollisionObject.o \
  373. $(BUILD_TEST_DIR)/Simulation.o \
  374. $(BUILD_TEST_DIR)/Vector3d.o \
  375. $(BUILD_TEST_DIR)/Matrix.o \
  376. $(BUILD_TEST_DIR)/ViewVolume.o \
  377. $(BUILD_TEST_DIR)/BoundingVolume.o \
  378. $(BUILD_TEST_DIR)/Quaternion.o \
  379. $(BUILD_TEST_DIR)/math.o
  380. Spring.test:
  381. mkdir -p $(BUILD_TEST_DIR)
  382. $(MAKE) targets NAME=Spring.test BUILDDIR=$(BUILD_TEST_DIR) \
  383. OBJS="$(HEL_PARTICLE_OBJS)" \
  384. CFLAGS="$(HEL_PARTICLE_CFLAGS)" \
  385. LD_FLAGS="-lm -lstdc++ -lGL -lGLU $(shell sdl-config --libs)"
  386. #################################################################
  387. Hel.test: Quaternion.test Matrix.test Math.test
  388. Matrix.test:
  389. @-echo "Building Matrix unit test"
  390. mkdir -p $(BUILD_TEST_DIR)
  391. $(CC) -Wall -g -DMATRIX_UNIT_TEST -lm -lstdc++ -Isrc \
  392. src/hel/Matrix.cpp src/hel/Quaternion.cpp src/hel/Vector3d.cpp \
  393. -o $(BUILD_TEST_DIR)/Matrix.test
  394. @-echo "================================================="
  395. @-echo "Running Matrix unit test"
  396. $(BUILD_TEST_DIR)/Matrix.test
  397. Quaternion.test:
  398. @-echo "Building Quaternion unit test"
  399. mkdir -p $(BUILD_TEST_DIR)
  400. $(CC) -Wall -g -DQUATERNION_UNIT_TEST -lm -lstdc++ -Isrc \
  401. src/hel/Quaternion.cpp -o $(BUILD_TEST_DIR)/Quaternion.test
  402. @-echo "================================================="
  403. @-echo "Running Quaternion unit test"
  404. $(BUILD_TEST_DIR)/Quaternion.test
  405. Math.test:
  406. @-echo "Building Math unit test"
  407. mkdir -p $(BUILD_TEST_DIR)
  408. $(CC) -Wall -g -DMATH_UNIT_TEST -lm -lstdc++ -Isrc \
  409. src/hel/math.cpp -o $(BUILD_TEST_DIR)/Math.test
  410. @-echo "================================================="
  411. @-echo "Running hel unit test"
  412. $(BUILD_TEST_DIR)/Math.test
  413. #################################################################
  414. Memeory.test:
  415. mkdir -p $(BUILD_TEST_DIR)
  416. $(CC) -Wall -g -D__TEST__ -lstdc++ \
  417. -DDEBUG_MEMEORY -DDEBUG_MEMEORY_ERROR \
  418. src/memeory_test.cpp -o $(BUILD_TEST_DIR)/memeory_test.test
  419. #################################################################
  420. Network.test:
  421. mkdir -p $(BUILD_TEST_DIR)
  422. $(CC) $(TEST_FLAGS) -DUNIT_TEST_NETWORK \
  423. src/Network.cpp -o $(BUILD_TEST_DIR)/Network.test
  424. #################################################################
  425. Sound.test:
  426. mkdir -p $(BUILD_TEST_DIR)
  427. $(CC) $(TEST_FLAGS) -DUNIT_TEST_SOUND \
  428. -DUSING_OPENAL -DHAVE_OPENAL $(AUDIO_LIBS) \
  429. src/Sound.cpp -o $(BUILD_TEST_DIR)/Sound.test
  430. ifeq ($(UNAME),Darwin)
  431. install_name_tool -change libalut.0.1.0.dylib /opt/local/lib/libalut.0.1.0.dylib $(BUILD_TEST_DIR)/Sound.test
  432. endif
  433. #################################################################
  434. PSKModel.test:
  435. mkdir -p $(BUILD_TEST_DIR)
  436. $(MAKE) targets NAME=PSKModel.test BUILDDIR=$(BUILD_TEST_DIR) \
  437. OBJS="$(BUILD_TEST_DIR)/PSKModel.o $(BUILD_TEST_DIR)/UTPackage.o $(BUILD_TEST_DIR)/mtk_tga.o $(BUILD_TEST_DIR)/Texture.o" \
  438. CFLAGS="-Wall -O0 -g -Isrc -DUNIT_TEST_PSKMODEL -DUSING_OPENGL $(shell sdl-config --cflags) -DUSING_MTK_TGA -DHAVE_SDL_TTF" \
  439. LD_FLAGS="-lm -lstdc++ -lGL -lGLU $(shell sdl-config --libs) -lSDL_ttf"
  440. #################################################################
  441. UTPackage.test:
  442. mkdir -p $(BUILD_TEST_DIR)
  443. $(MAKE) targets NAME=UTPackage.test BUILDDIR=$(BUILD_TEST_DIR) \
  444. OBJS="$(BUILD_TEST_DIR)/UTPackage.o $(BUILD_TEST_DIR)/mtk_tga.o" \
  445. CFLAGS="-Wall -O0 -g -Isrc -DUNIT_TEST_UTPACKAGE -DUSING_MTK_TGA" \
  446. LD_FLAGS="-lm -lstdc++"
  447. #################################################################