Open Source Tomb Raider Engine
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Makefile 16KB

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