Open Source Tomb Raider Engine
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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