Makefile 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. # NOTE: This Makefile requires GNU make
  2. # Location to put the targets.
  3. TARGETBINDIR = .
  4. TARGETLIBDIR = .
  5. # DLL version information. Currently this must be updated manually.
  6. # Fields are: major, minor, build number, QFE version
  7. VERSION_FIELD = 1,0,0,0
  8. VERSION_STRING = \\\"1.0\\\"
  9. # Name of the targets
  10. # Hooray for Windows DLL hell.
  11. LIBTHEORAENC_TARGET = libtheoraenc.dll
  12. LIBTHEORAENCD_TARGET = libtheoraencd.dll
  13. LIBTHEORAENC70_TARGET = libtheoraenc70.dll
  14. LIBTHEORAENC70D_TARGET = libtheoraenc70d.dll
  15. LIBTHEORAENC71_TARGET = libtheoraenc71.dll
  16. LIBTHEORAENC71D_TARGET = libtheoraenc71d.dll
  17. LIBTHEORAENC80_TARGET = libtheoraenc80.dll
  18. LIBTHEORAENC80D_TARGET = libtheoraenc80d.dll
  19. LIBTHEORADEC_TARGET = libtheoradec.dll
  20. LIBTHEORADECD_TARGET = libtheoradecd.dll
  21. LIBTHEORADEC70_TARGET = libtheoradec70.dll
  22. LIBTHEORADEC70D_TARGET = libtheoradec70d.dll
  23. LIBTHEORADEC71_TARGET = libtheoradec71.dll
  24. LIBTHEORADEC71D_TARGET = libtheoradec71d.dll
  25. LIBTHEORADEC80_TARGET = libtheoradec80.dll
  26. LIBTHEORADEC80D_TARGET = libtheoradec80d.dll
  27. DUMP_VIDEO_TARGET = dump_video.exe
  28. PLAYER_EXAMPLE_TARGET = player_example.exe
  29. ENCODER_EXAMPLE_TARGET = encoder_example.exe
  30. # The compiler tools to use
  31. # The is no standard mingw prefix, so try to guess
  32. MINGW_PREFIX := $(or $(strip $(foreach exeprefix, \
  33. i686-mingw32 i686-pc-mingw32 i586-mingw32msvc i386-mingw32 \
  34. no-mingw32, \
  35. $(if $(shell which $(exeprefix)-gcc 2>/dev/null), $(exeprefix) ))))
  36. CC = $(MINGW_PREFIX)-gcc
  37. RC = $(MINGW_PREFIX)-windres
  38. DLLTOOL = $(MINGW_PREFIX)-dlltool
  39. LD = $(MINGW_PREFIX)-ld
  40. SDLCONFIG = $(MINGW_PREFIX)-sdl-config
  41. # The command to use to generate dependency information
  42. MAKEDEPEND = ${CC} -MM
  43. #MAKEDEPEND = makedepend -f- -Y --
  44. # The location of include files.
  45. # Modify these to point to your Ogg and Vorbis include directories if they are
  46. # not installed in a standard location.
  47. CINCLUDE = -D_REENTRANT
  48. # Extra compilation flags.
  49. # You may get speed increases by including flags such as -O2 or -O3 or
  50. # -ffast-math, or additional flags, depending on your system and compiler.
  51. # The correct -march=<architecture> flag will also generate much better code
  52. # on newer architectures.
  53. CFLAGS = -Wall -Wno-parentheses -DOC_X86_ASM
  54. RELEASE_CFLAGS = ${CFLAGS} -mtune=native -O3 -fomit-frame-pointer -fforce-addr \
  55. -finline-functions
  56. # The -g flag will generally include debugging information.
  57. DEBUG_CFLAGS = ${CFLAGS} -g
  58. # Libraries to link with, and the location of library files.
  59. LIBS = -logg -lvorbis -lvorbisenc
  60. # ANYTHING BELOW THIS LINE PROBABLY DOES NOT NEED EDITING
  61. CINCLUDE := -I../../include ${CINCLUDE}
  62. LIBSRCDIR = ../../lib
  63. BINSRCDIR = ../../examples
  64. WORKDIR = objs
  65. # C source file lists
  66. LIBTHEORADEC_CSOURCES = \
  67. apiwrapper.c \
  68. bitpack.c \
  69. decapiwrapper.c \
  70. decinfo.c \
  71. decode.c \
  72. dequant.c \
  73. fragment.c \
  74. huffdec.c \
  75. idct.c \
  76. info.c \
  77. internal.c \
  78. quant.c \
  79. state.c \
  80. $(if $(findstring -DOC_X86_ASM,${CFLAGS}), \
  81. x86/mmxidct.c \
  82. x86/mmxfrag.c \
  83. x86/mmxstate.c \
  84. x86/x86state.c \
  85. )
  86. LIBTHEORAENC_CSOURCES = \
  87. apiwrapper.c \
  88. fragment.c \
  89. idct.c \
  90. internal.c \
  91. state.c \
  92. quant.c \
  93. analyze.c \
  94. fdct.c \
  95. encfrag.c \
  96. encapiwrapper.c \
  97. encinfo.c \
  98. encode.c \
  99. enquant.c \
  100. huffenc.c \
  101. mathops.c \
  102. mcenc.c \
  103. rate.c \
  104. tokenize.c \
  105. $(if $(findstring -DOC_X86_ASM,${CFLAGS}), \
  106. x86/mmxfrag.c \
  107. x86/mmxidct.c \
  108. x86/mmxstate.c \
  109. x86/x86state.c \
  110. x86/mmxencfrag.c \
  111. x86/mmxfdct.c \
  112. x86/x86enc.c \
  113. )
  114. DUMP_VIDEO_CSOURCES = dump_video.c
  115. ENCODER_EXAMPLE_CSOURCES = encoder_example.c
  116. PLAYER_EXAMPLE_CSOURCES = player_example.c
  117. # Create object file list.
  118. LIBTHEORADEC_OBJS:= ${LIBTHEORADEC_CSOURCES:%.c=${WORKDIR}/%.o}
  119. LIBTHEORADECD_OBJS:= ${LIBTHEORADEC_CSOURCES:%.c=${WORKDIR}/%.do}
  120. LIBTHEORAENC_OBJS:= ${LIBTHEORAENC_CSOURCES:%.c=${WORKDIR}/%.o}
  121. LIBTHEORAENCD_OBJS:= ${LIBTHEORAENC_CSOURCES:%.c=${WORKDIR}/%.do}
  122. DUMP_VIDEO_OBJS:= ${DUMP_VIDEO_CSOURCES:%.c=${WORKDIR}/%.o}
  123. ENCODER_EXAMPLE_OBJS:= ${ENCODER_EXAMPLE_CSOURCES:%.c=${WORKDIR}/%.o}
  124. PLAYER_EXAMPLE_OBJS:= ${PLAYER_EXAMPLE_CSOURCES:%.c=${WORKDIR}/%.o}
  125. RC_OBJS:= ${LIBTHEORADEC_TARGET} ${LIBTHEORAENC_TARGET} \
  126. ${LIBTHEORADECD_TARGET} ${LIBTHEORAENCD_TARGET} \
  127. ${LIBTHEORADEC70_TARGET} ${LIBTHEORAENC70_TARGET} \
  128. ${LIBTHEORADEC70D_TARGET} ${LIBTHEORAENC70D_TARGET} \
  129. ${LIBTHEORADEC71_TARGET} ${LIBTHEORAENC71_TARGET} \
  130. ${LIBTHEORADEC71D_TARGET} ${LIBTHEORAENC71D_TARGET} \
  131. ${LIBTHEORADEC80_TARGET} ${LIBTHEORAENC80_TARGET} \
  132. ${LIBTHEORADEC80D_TARGET} ${LIBTHEORAENC80D_TARGET}
  133. RC_OBJS:= ${RC_OBJS:%.dll=${WORKDIR}/%.rco}
  134. ALL_OBJS:= ${LIBTHEORADEC_OBJS} ${LIBTHEORAENC_OBJS} \
  135. ${LIBTHEORADECD_OBJS} ${LIBTHEORAENCD_OBJS} ${RC_OBJS} \
  136. ${DUMP_VIDEO_OBJS} ${ENCODER_EXAMPLE_OBJS} #${PLAYER_EXAMPLE_OBJS}
  137. # Create the dependency file list
  138. ALL_DEPS:= ${ALL_OBJS:%.o=%.d}
  139. ALL_DEPS:= ${ALL_DEPS:%.do=%.dd}
  140. ALL_DEPS:= ${ALL_DEPS:%.rco=%.d}
  141. # Prepend source path to file names.
  142. LIBTHEORADEC_CSOURCES:= ${LIBTHEORADEC_CSOURCES:%=${LIBSRCDIR}/%}
  143. LIBTHEORAENC_CSOURCES:= ${LIBTHEORAENC_CSOURCES:%=${LIBSRCDIR}/%}
  144. DUMP_VIDEO_CSOURCES:= ${DUMP_VIDEO_CSOURCES:%=${BINSRCDIR}/%}
  145. ENCODER_EXAMPLE_CSOURCES:= ${ENCODER_EXAMPLE_CSOURCES:%=${BINSRCDIR}/%}
  146. PLAYER_EXAMPLE_CSOURCES:= ${PLAYER_EXAMPLE_CSOURCES:%=${BINSRCDIR}/%}
  147. ALL_CSOURCES:= ${LIBTHEORADEC_CSOURCES} ${LIBTHEORAENC_CSOURCES} \
  148. ${DUMP_VIDEO_CSOURCES} ${PLAYER_EXAMPLE_CSOURCES} \
  149. ${ENCODER_EXAMPLE_CSOURCES}
  150. LIBTHEORAENC_RCO:= ${WORKDIR}/${LIBTHEORAENC_TARGET:%.dll=%.rco}
  151. LIBTHEORAENCD_RCO:= ${WORKDIR}/${LIBTHEORAENCD_TARGET:%.dll=%.rco}
  152. LIBTHEORAENC70_RCO:= ${WORKDIR}/${LIBTHEORAENC70_TARGET:%.dll=%.rco}
  153. LIBTHEORAENC70D_RCO:= ${WORKDIR}/${LIBTHEORAENC70D_TARGET:%.dll=%.rco}
  154. LIBTHEORAENC71_RCO:= ${WORKDIR}/${LIBTHEORAENC71_TARGET:%.dll=%.rco}
  155. LIBTHEORAENC71D_RCO:= ${WORKDIR}/${LIBTHEORAENC71D_TARGET:%.dll=%.rco}
  156. LIBTHEORAENC80_RCO:= ${WORKDIR}/${LIBTHEORAENC80_TARGET:%.dll=%.rco}
  157. LIBTHEORAENC80D_RCO:= ${WORKDIR}/${LIBTHEORAENC80D_TARGET:%.dll=%.rco}
  158. LIBTHEORADEC_RCO:= ${WORKDIR}/${LIBTHEORADEC_TARGET:%.dll=%.rco}
  159. LIBTHEORADECD_RCO:= ${WORKDIR}/${LIBTHEORADECD_TARGET:%.dll=%.rco}
  160. LIBTHEORADEC70_RCO:= ${WORKDIR}/${LIBTHEORADEC70_TARGET:%.dll=%.rco}
  161. LIBTHEORADEC70D_RCO:= ${WORKDIR}/${LIBTHEORADEC70D_TARGET:%.dll=%.rco}
  162. LIBTHEORADEC71_RCO:= ${WORKDIR}/${LIBTHEORADEC71_TARGET:%.dll=%.rco}
  163. LIBTHEORADEC71D_RCO:= ${WORKDIR}/${LIBTHEORADEC71D_TARGET:%.dll=%.rco}
  164. LIBTHEORADEC80_RCO:= ${WORKDIR}/${LIBTHEORADEC80_TARGET:%.dll=%.rco}
  165. LIBTHEORADEC80D_RCO:= ${WORKDIR}/${LIBTHEORADEC80D_TARGET:%.dll=%.rco}
  166. # Prepand target path to file names.
  167. LIBTHEORAENC_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC_TARGET}
  168. LIBTHEORAENCD_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENCD_TARGET}
  169. LIBTHEORAENC70_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC70_TARGET}
  170. LIBTHEORAENC70D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC70D_TARGET}
  171. LIBTHEORAENC71_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC71_TARGET}
  172. LIBTHEORAENC71D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC71D_TARGET}
  173. LIBTHEORAENC80_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC80_TARGET}
  174. LIBTHEORAENC80D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORAENC80D_TARGET}
  175. LIBTHEORADEC_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC_TARGET}
  176. LIBTHEORADECD_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADECD_TARGET}
  177. LIBTHEORADEC70_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC70_TARGET}
  178. LIBTHEORADEC70D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC70D_TARGET}
  179. LIBTHEORADEC71_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC71_TARGET}
  180. LIBTHEORADEC71D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC71D_TARGET}
  181. LIBTHEORADEC80_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC80_TARGET}
  182. LIBTHEORADEC80D_TARGET:= ${TARGETLIBDIR}/${LIBTHEORADEC80D_TARGET}
  183. DUMP_VIDEO_TARGET:= ${TARGETBINDIR}/${DUMP_VIDEO_TARGET}
  184. ENCODER_EXAMPLE_TARGET:= ${TARGETBINDIR}/${ENCODER_EXAMPLE_TARGET}
  185. PLAYER_EXAMPLE_TARGET:= ${TARGETBINDIR}/${PLAYER_EXAMPLE_TARGET}
  186. DLL_TARGETS:= ${LIBTHEORADEC_TARGET} ${LIBTHEORAENC_TARGET} \
  187. ${LIBTHEORADECD_TARGET} ${LIBTHEORAENCD_TARGET} \
  188. ${LIBTHEORADEC70_TARGET} ${LIBTHEORAENC70_TARGET} \
  189. ${LIBTHEORADEC70D_TARGET} ${LIBTHEORAENC70D_TARGET} \
  190. ${LIBTHEORADEC71_TARGET} ${LIBTHEORAENC71_TARGET} \
  191. ${LIBTHEORADEC71D_TARGET} ${LIBTHEORAENC71D_TARGET} \
  192. ${LIBTHEORADEC80_TARGET} ${LIBTHEORAENC80_TARGET} \
  193. ${LIBTHEORADEC80D_TARGET} ${LIBTHEORAENC80D_TARGET}
  194. ALL_TARGETS:= ${DLL_TARGETS} ${DLL_TARGETS:%.dll=%.dll.a} \
  195. ${DUMP_VIDEO_TARGET} ${ENCODER_EXAMPLE_TARGET} #${PLAYER_EXAMPLE_TARGET}
  196. IMPLIB_TARGETS:= ${DLL_TARGETS:%.dll=%.def} ${DLL_TARGETS:%.dll=%.lib} \
  197. ${DLL_TARGETS:%.dll=%.exp}
  198. # Targets:
  199. # Everything (default)
  200. all: ${ALL_TARGETS}
  201. # These require Microsoft's lib.exe to build, and so are not made by default.
  202. implibs: ${IMPLIB_TARGETS}
  203. # libtheoradec
  204. ${LIBTHEORADEC_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC_RCO} \
  205. libtheoradec-all.def
  206. mkdir -p ${TARGETLIBDIR}
  207. ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcrt \
  208. ${LIBTHEORADEC_RCO} \
  209. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  210. ${LIBTHEORADECD_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADECD_RCO} \
  211. libtheoradec-all.def
  212. mkdir -p ${TARGETLIBDIR}
  213. ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcrtd \
  214. ${LIBTHEORADECD_RCO} \
  215. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  216. ${LIBTHEORADEC70_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC70_RCO} \
  217. libtheoradec-all.def
  218. mkdir -p ${TARGETLIBDIR}
  219. ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr70 \
  220. ${LIBTHEORADEC70_RCO} \
  221. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  222. ${LIBTHEORADEC70D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC70D_RCO} \
  223. libtheoradec-all.def
  224. mkdir -p ${TARGETLIBDIR}
  225. ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr70d \
  226. ${LIBTHEORADEC70D_RCO} \
  227. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  228. ${LIBTHEORADEC71_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC71_RCO} \
  229. libtheoradec-all.def
  230. mkdir -p ${TARGETLIBDIR}
  231. ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr71 \
  232. ${LIBTHEORADEC71_RCO} \
  233. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  234. ${LIBTHEORADEC71D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC71D_RCO} \
  235. libtheoradec-all.def
  236. mkdir -p ${TARGETLIBDIR}
  237. ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr71d \
  238. ${LIBTHEORADEC71D_RCO} \
  239. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  240. ${LIBTHEORADEC80_TARGET}: ${LIBTHEORADEC_OBJS} ${LIBTHEORADEC80_RCO} \
  241. libtheoradec-all.def
  242. mkdir -p ${TARGETLIBDIR}
  243. ${CC} -shared -o $@ ${LIBTHEORADEC_OBJS} -logg -lmsvcr80 \
  244. ${LIBTHEORADEC80_RCO} \
  245. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  246. ${LIBTHEORADEC80D_TARGET}: ${LIBTHEORADECD_OBJS} ${LIBTHEORADEC80D_RCO} \
  247. libtheoradec-all.def
  248. mkdir -p ${TARGETLIBDIR}
  249. ${CC} -shared -o $@ ${LIBTHEORADECD_OBJS} -logg -lmsvcr80d \
  250. ${LIBTHEORADEC80D_RCO} \
  251. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoradec-all.def
  252. # libtheoraenc
  253. ${LIBTHEORAENC_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC_RCO} \
  254. libtheoraenc-all.def
  255. mkdir -p ${TARGETLIBDIR}
  256. ${CC} -shared -o $@ \
  257. ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC_TARGET} -logg -lmsvcrt \
  258. ${LIBTHEORAENC_RCO} \
  259. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  260. ${LIBTHEORAENCD_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENCD_RCO} \
  261. libtheoraenc-all.def
  262. mkdir -p ${TARGETLIBDIR}
  263. ${CC} -shared -o $@ \
  264. ${LIBTHEORAENCD_OBJS} ${LIBTHEORADECD_TARGET} -logg -lmsvcrtd \
  265. ${LIBTHEORAENCD_RCO} \
  266. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  267. ${LIBTHEORAENC70_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC70_RCO} \
  268. libtheoraenc-all.def
  269. mkdir -p ${TARGETLIBDIR}
  270. ${CC} -shared -o $@ \
  271. ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC70_TARGET} -logg -lmsvcr70 \
  272. ${LIBTHEORAENC70_RCO} \
  273. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  274. ${LIBTHEORAENC70D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC70D_RCO} \
  275. libtheoraenc-all.def
  276. mkdir -p ${TARGETLIBDIR}
  277. ${CC} -shared -o $@ \
  278. ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC70D_TARGET} -logg -lmsvcr70d \
  279. ${LIBTHEORAENC70D_RCO} \
  280. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  281. ${LIBTHEORAENC71_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC71_RCO} \
  282. libtheoraenc-all.def
  283. mkdir -p ${TARGETLIBDIR}
  284. ${CC} -shared -o $@ \
  285. ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC71_TARGET} -logg -lmsvcr71 \
  286. ${LIBTHEORAENC71_RCO} \
  287. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  288. ${LIBTHEORAENC71D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC71D_RCO} \
  289. libtheoraenc-all.def
  290. mkdir -p ${TARGETLIBDIR}
  291. ${CC} -shared -o $@ \
  292. ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC71D_TARGET} -logg -lmsvcr71d \
  293. ${LIBTHEORAENC71D_RCO} \
  294. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  295. ${LIBTHEORAENC80_TARGET}: ${LIBTHEORAENC_OBJS} ${LIBTHEORAENC80_RCO} \
  296. libtheoraenc-all.def
  297. mkdir -p ${TARGETLIBDIR}
  298. ${CC} -shared -o $@ \
  299. ${LIBTHEORAENC_OBJS} ${LIBTHEORADEC80_TARGET} -logg -lmsvcr80 \
  300. ${LIBTHEORAENC80_RCO} \
  301. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  302. ${LIBTHEORAENC80D_TARGET}: ${LIBTHEORAENCD_OBJS} ${LIBTHEORAENC80D_RCO} \
  303. libtheoraenc-all.def
  304. mkdir -p ${TARGETLIBDIR}
  305. ${CC} -shared -o $@ \
  306. ${LIBTHEORAENCD_OBJS} ${LIBTHEORADEC80D_TARGET} -logg -lmsvcr80d \
  307. ${LIBTHEORAENC80D_RCO} \
  308. -Wl,--output-def,${@:.dll=.def},--out-implib,$@.a,libtheoraenc-all.def
  309. # dump_video
  310. ${DUMP_VIDEO_TARGET}: ${DUMP_VIDEO_OBJS} ${LIBTHEORADEC_TARGET}
  311. mkdir -p ${TARGETBINDIR}
  312. ${CC} ${CFLAGS} -o $@ ${DUMP_VIDEO_OBJS} ${LIBS} \
  313. ${LIBTHEORADEC_TARGET}.a
  314. # encoder_example
  315. ${ENCODER_EXAMPLE_TARGET}: ${ENCODER_EXAMPLE_OBJS} ${LIBTHEORADEC_TARGET} \
  316. ${LIBTHEORAENC_TARGET}
  317. mkdir -p ${TARGETBINDIR}
  318. ${CC} ${CFLAGS} -o $@ ${ENCODER_EXAMPLE_OBJS} ${LIBS} \
  319. ${LIBTHEORAENC_TARGET}.a ${LIBTHEORADEC_TARGET}.a
  320. # player_example
  321. ${PLAYER_EXAMPLE_TARGET}: CINCLUDE += $(SDLCONFIG) --cflags
  322. ${PLAYER_EXAMPLE_TARGET}: ${PLAYER_EXAMPLE_OBJS} ${LIBTHEORADEC_TARGET}
  323. mkdir -p ${TARGETBINDIR}
  324. ${CC} ${CFLAGS} -o $@ ${PLAYER_EXAMPLE_OBJS} ${LIBS} \
  325. ${LIBTHEORADEC_TARGET}.a `${SDLCONFIG} --libs`
  326. # Remove all targets.
  327. clean:
  328. -rm $(sort ${ALL_OBJS} ${ALL_DEPS} ${ALL_TARGETS} ${IMPLIB_TARGETS})
  329. -rmdir ${WORKDIR}/x86
  330. -rmdir ${WORKDIR}
  331. # Make everything depend on changes in the Makefile
  332. ${ALL_OBJS} ${ALL_DEPS} ${ALL_TARGETS} : Makefile
  333. # Specify which targets are phony for GNU make
  334. .PHONY : all clean
  335. # Rules
  336. # Windows-specific rules
  337. %.dll.a : %.dll
  338. %.def : %.dll
  339. %.exp : %.lib
  340. %.lib : %.def
  341. wine lib /machine:i386 /def:$<
  342. ${WORKDIR}/%.d : %.rc
  343. mkdir -p ${dir $@}
  344. ${MAKEDEPEND} -x c-header ${CINCLUDE} $< -MT ${@:%.d=%.rco} > $@
  345. ${WORKDIR}/%.rco : %.rc
  346. mkdir -p ${dir $@}
  347. ${RC} ${CINCLUDE} -DTH_VERSION_FIELD=${VERSION_FIELD} \
  348. -DTH_VERSION_STRING=${VERSION_STRING} $< $@
  349. # Normal compilation
  350. ${WORKDIR}/%.d : ${LIBSRCDIR}/%.c
  351. mkdir -p ${dir $@}
  352. ${MAKEDEPEND} ${CINCLUDE} ${RELEASE_CFLAGS} $< -MT ${@:%.d=%.o} > $@
  353. ${WORKDIR}/%.d : ${BINSRCDIR}/%.c
  354. mkdir -p ${dir $@}
  355. ${MAKEDEPEND} ${CINCLUDE} ${RELEASE_CFLAGS} $< -MT ${@:%.d=%.o} > $@
  356. ${WORKDIR}/%.o : ${LIBSRCDIR}/%.c
  357. mkdir -p ${dir $@}
  358. ${CC} ${CINCLUDE} ${RELEASE_CFLAGS} -c -o $@ $<
  359. ${WORKDIR}/%.o : ${BINSRCDIR}/%.c
  360. mkdir -p ${dir $@}
  361. ${CC} ${CINCLUDE} ${RELEASE_CFLAGS} -c -o $@ $<
  362. # Debug versions
  363. ${WORKDIR}/%.dd : ${LIBSRCDIR}/%.c
  364. mkdir -p ${dir $@}
  365. ${MAKEDEPEND} ${CINCLUDE} ${DEBUG_CFLAGS} $< -MT ${@:%.d=%.do} > $@
  366. ${WORKDIR}/%.do : ${LIBSRCDIR}/%.c
  367. mkdir -p ${dir $@}
  368. ${CC} ${CINCLUDE} ${DEBUG_CFLAGS} -c -o $@ $<
  369. # Include header file dependencies
  370. -include ${ALL_DEPS}