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 16KB

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