makefile 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. everything : all
  2. ###### dxv standard project specs
  3. PROJECT = dxv
  4. # project name
  5. # standard modules for this library
  6. OBJS = \
  7. $(OBJDIR)dxlcsize.$(OBJ) \
  8. $(OBJDIR)dxv_init.$(OBJ) \
  9. $(OBJDIR)dxv_initex.$(OBJ) \
  10. $(OBJDIR)dxl_main.$(OBJ) \
  11. $(OBJDIR)vscreen.$(OBJ) \
  12. $(OBJDIR)ximage.$(OBJ) \
  13. $(OBJDIR)ximgblit.$(OBJ) \
  14. $(OBJDIR)getprefs.$(OBJ) \
  15. $(OBJDIR)dxl_clip.$(OBJ) \
  16. $(OBJDIR)dxl_bkgr.$(OBJ) \
  17. $(OBJDIR)dxl_view.$(OBJ) \
  18. $(OBJDIR)vgetview.$(OBJ) \
  19. $(OBJDIR)vscerase.$(OBJ) \
  20. $(OBJDIR)dxl_attr.$(OBJ) \
  21. $(OBJDIR)dxl_reg.$(OBJ) \
  22. $(OBJDIR)dxl_feat.$(OBJ) \
  23. $(OBJDIR)genximg.$(OBJ) \
  24. $(OBJDIR)svsbitdp.$(OBJ) \
  25. $(OBJDIR)vscraddr.$(OBJ) \
  26. $(OBJDIR)blitall.$(OBJ) \
  27. $(OBJDIR)dxlvinfd.$(OBJ) \
  28. $(OBJDIR)cpuid.$(OBJ) \
  29. $(OBJDIR)count_tm.$(OBJ)
  30. !ifndef NOCLUT
  31. OBJS = $(OBJS) \
  32. $(OBJDIR)dxl_clut.$(OBJ)
  33. !endif
  34. !ifndef NOLOGO
  35. OBJS = $(OBJS) \
  36. $(OBJDIR)on2logo.$(OBJ) \
  37. $(OBJDIR)tmlogo55.$(OBJ) \
  38. $(OBJDIR)tmlogo56.$(OBJ) \
  39. $(OBJDIR)tmlogo24.$(OBJ) \
  40. $(OBJDIR)ducklogo.$(OBJ)
  41. !endif
  42. MAJREV = 6 # major library revision
  43. MINREV = 0 # minor library revision
  44. PVER = 1 # minor.minor library revision
  45. BVER = ".b1" # build version
  46. # libraries on which this should be built
  47. !if 0
  48. $(LIBDIR)$(LIBPREFIX)tmrt$(LIBSUFFIX) \
  49. $(LIBDIR)$(LIBPREFIX)tm1$(LIBSUFFIX) \
  50. $(LIBDIR)$(LIBPREFIX)tm20$(LIBSUFFIX) \
  51. $(LIBDIR)$(LIBPREFIX)vp3$(LIBSUFFIX) \
  52. $(LIBDIR)$(LIBPREFIX)vp31d$(LIBSUFFIX)
  53. !endif
  54. !if 0
  55. USER_LIBS = \
  56. $(LIBDIR)$(LIBPREFIX)torq$(LIBSUFFIX)
  57. !endif
  58. #
  59. # project sub options sent to compilers
  60. #
  61. !ifndef CENV
  62. CENV = -DTORQB -DTM1B -DTM2B -DTMRTB
  63. !endif
  64. # add sub-options to c options (allows for environment override)
  65. C_FLAGS = $(CENV)
  66. c_flags = $(C_FLAGS)
  67. # this proj library is to be built as a shared or master library
  68. SHAREDLIB = 0
  69. M_INCLUDES = -I$(INCDIR)/$(OS) -I$(INCDIR) -I. -I../generic $(M_INCLUDES)
  70. # win95 specific modules
  71. OBJS = $(OBJS) \
  72. $(OBJDIR)dxv.$(OBJ) \
  73. $(OBJDIR)dkprof.$(OBJ) \
  74. $(OBJDIR)perf.$(OBJ) \
  75. $(OBJDIR)pentium.$(OBJ) \
  76. $(OBJDIR)$(PROJECT).res
  77. # modules specifically sent to linker,
  78. # others are provided in libraries
  79. DLLOBJS = $(OBJDIR)dxl_main.obj \
  80. $(OBJDIR)dxv_mem.$(OBJ) \
  81. $(OBJDIR)dxv_mems.$(OBJ) \
  82. $(OBJDIR)$(PROJECT).res \
  83. $(OBJDIR)$(PROJECT).$(OBJ)
  84. PROJLIBS = $(PROJLIBS)
  85. #$(OBJDIR)sc_$(PROJECT).lib
  86. THISFILE = makefile
  87. SRCDIR = .
  88. GENDIR = ..\generic
  89. OBJDIR = obj\
  90. LIBDIR = obj\
  91. INCDIR = $(CORELIBS_INC)
  92. ASMDIR = ..\X86\
  93. MMXDIR = ..\mmx\
  94. WASMDIR = ..\wX86\
  95. OBJRELDIR = $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Release\
  96. OBJDEBDIR = $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Debug\
  97. LIBRELDIR = $(ROOT)Private\CoreLibs\Lib\$(OS)\Release
  98. LIBDEBDIR = $(ROOT)Private\CoreLibs\Lib\$(OS)\Debug
  99. OBJ = obj
  100. MKDIR =
  101. # tools
  102. CC = cl
  103. ASM = tasm /ml /m8 /dWINP /zd /I$(ASMDIR) /dWIN95
  104. WASM = wasm /dWINP /dWIN95 /I=$(ASMDIR) /I=$(MMXDIR) -q
  105. RC = rc
  106. LIBNAME = $(OBJDIR)$(PROJECT).lib
  107. SLIBNAME = $(OBJDIR)s_$(PROJECT).lib
  108. EXENAME = $(OBJDIR)$(PROJECT).exe
  109. ###DEFNAME = $(SRCDIR)$(PROJECT).DEF
  110. DEFNAME = $(PROJECT).DEF
  111. LIBPREFIX = \s_
  112. LIBSUFFIX = .lib
  113. # Include Path Variable Extensible
  114. include = $(SDK)/inc;$(include)
  115. ############################################################
  116. # Global Flags (compiler / linker)
  117. C_FLAGS = $(C_FLAGS) -Gy -W3 -nologo -DWIN32 -D_MBCS -D_AFXDLL -D_WINDOWS -DHIRES\
  118. -DDOS32 -c $(M_INCLUDES:/=\)
  119. #-WX
  120. L_FLAGS = $(L_FLAGS) /SUBSYSTEM:windows /INCREMENTAL:no /MACHINE:I386
  121. ############################################################
  122. # Locally Overridable Flags
  123. !ifndef DLLNAME
  124. DLLNAME = $(OBJDIR)$(PROJECT).dll
  125. !endif
  126. !ifndef c_thread
  127. ## SJL - NEED TO USE LIBCMT NOW
  128. ## c_thread = -MD
  129. c_thread = -MT
  130. !endif
  131. !ifndef c_ndebugflags
  132. c_ndebugflags = -DNDEBUG -Ob2 -Ot -O2 -G5
  133. !endif
  134. !ifndef c_debugflags
  135. c_debugflags = -D_DEBUG -GX -Od -Z7
  136. !endif
  137. !ifndef l_ndebugflags
  138. l_ndebugflags =
  139. !endif
  140. !ifndef l_debugflags
  141. l_debugflags = -DEBUG -DEBUGTYPE:BOTH
  142. !endif
  143. # exe flags / objects
  144. !ifndef l_exe_flags
  145. l_exe_flags =
  146. !endif
  147. # DLL flags / objects
  148. !ifndef l_dll_flags
  149. l_dll_flags = -DLL -DEF:$(DEFNAME)
  150. !endif
  151. !ifndef DLLOBJS
  152. DLLOBJS = $(OBJS)
  153. !endif
  154. # targets we will build
  155. !ifndef targets
  156. targets = $(SLIBNAME)
  157. !ifdef SHAREDLIB
  158. !if $(SHAREDLIB) == 1
  159. targets = $(TARGETS) $(DLLNAME)
  160. !endif
  161. !endif
  162. !endif
  163. # versions we will build
  164. !ifndef VERSIONS
  165. VERSIONS = release.ver debug.ver
  166. !endif
  167. ############################################################
  168. # inference rules
  169. # -mkdir $(OBJDIR:\= )
  170. # -mkdir $(MKOBJDIR:\= )
  171. # Target Directories
  172. #$(OBJDIR:\= ) :
  173. !if 0
  174. $(OBJDIR:\= ) :
  175. mkdir $*
  176. cd $*
  177. !endif
  178. $(LIBDIR) :
  179. # -mkdir $(LIBDIR)\..
  180. -mkdir $(MKLIBDIR)
  181. # Object files
  182. {$(GENDIR)}.c{$(OBJDIR)}.obj:
  183. $(CC) $(C_FLAGS) $< -Fo$@
  184. {$(GENDIR)}.cpp{$(OBJDIR)}.obj:
  185. $(CC) $(C_FLAGS) $< -Fo$@
  186. {$(SRCDIR)}.c{$(OBJDIR)}.obj:
  187. $(CC) $(C_FLAGS) $< -Fo$@
  188. {$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
  189. $(CC) $(C_FLAGS) $< -Fo$@
  190. {$(WASMDIR)}.asm{$(OBJDIR)}.obj:
  191. $(WASM) $< -fo=$@
  192. editbin /NOLOGO /RELEASE $@
  193. {$(ASMDIR)}.asm{$(OBJDIR)}.obj:
  194. $(ASM) $< $@
  195. editbin /NOLOGO /RELEASE $@
  196. {$(SRCDIR)}.rc{$(OBJDIR)}.res:
  197. $(RC) /fo$@ /dALG="$(CENV:-D= )" /dPROJ=$(PROJECT) /dMAJ=$(MAJREV) /dMIN=$(MINREV) /dPVER=$(PVER) /dBVER=$(BVER) $<
  198. #
  199. # building of targets
  200. #
  201. ###$(SLIBNAME): $(OBJDIR:\= ) $(LIBDIR) $(OBJS)
  202. $(SLIBNAME): $(OBJS)
  203. LIB $(OBJS) /OUT:$@
  204. !ifdef USER_LIBS
  205. for %i in ($(USER_LIBS)) do LIB $(SLIBNAME) %i /OUT:$@
  206. !endif
  207. copy $(SLIBNAME) $(LIBDIR)
  208. ##$(DLLNAME): $(SLIBNAME) $(OBJDIR:\= ) $(LIBDIR) $(DEFNAME) $(OBJDIR)$(PROJECT).res $(SLIBNAME) $(DLLOBJS)
  209. $(DLLNAME): $(SLIBNAME) $(LIBDIR) $(DEFNAME) $(OBJDIR)$(PROJECT).res $(SLIBNAME) $(DLLOBJS)
  210. link $(L_FLAGS) $(l_dll_flags) /OUT:$(DLLNAME) $(DLLOBJS) $(SLIBNAME) /MAP:$(OBJDIR)$(PROJECT).map
  211. copy $@ $(LIBDIR)
  212. copy $(LIBNAME) $(LIBDIR)
  213. $(EXENAME): $(OBJDIR:\= ) $(DEFNAME) $(OBJDIR)$(PROJECT).res $(OBJS)
  214. link $(L_FLAGS) $(l_exe_flags) /OUT:$(EXENAME) $(OBJS) /MAP:$(OBJDIR)$(PROJECT).map
  215. #
  216. # Goals
  217. #
  218. build_me: $(targets) $(PROJLIBS)
  219. @echo Build Completed
  220. #
  221. # there should be a more elegant way to build the following directories
  222. #
  223. build_dirs:
  224. @echo BUILDING DIRECTORIES
  225. mkdir $(ROOT)Object
  226. mkdir $(ROOT)Object\CoreLibs
  227. mkdir $(ROOT)Object\CoreLibs\$(PROJECT)
  228. mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx
  229. mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)
  230. mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)
  231. mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Release
  232. mkdir $(ROOT)Object\CoreLibs\$(PROJECT)\Dx\$(OS)\Debug
  233. release.ver:
  234. set C_FLAGS=$(C_FLAGS) $(c_ndebugflags) $(c_thread) $(c_local)
  235. set L_FLAGS=$(L_FLAGS) $(l_ndebugflags)
  236. set OBJDIR=$(OBJRELDIR)
  237. set LIBDIR=$(LIBRELDIR)
  238. nmake /NOLOGO /C /S build_dirs
  239. nmake /NOLOGO -f $(THISFILE) build_me
  240. debug.ver:
  241. @echo NOW DOING DEBUG VERSION
  242. set C_FLAGS=$(C_FLAGS) $(c_debugflags) $(c_thread) $(c_local)
  243. set L_FLAGS=$(L_FLAGS) $(l_debugflags)
  244. set OBJDIR=$(OBJDEBDIR)
  245. set LIBDIR=$(LIBDEBDIR)
  246. nmake /NOLOGO /C /S build_dirs
  247. nmake /NOLOGO -f $(THISFILE) build_me
  248. all:: $(VERSIONS)
  249. clean:
  250. deltree /Y obj
  251. deltree /Y obj.*
  252. $(OBJDIR)sc_$(PROJECT).lib: $(LIBDIR)\sc_tm20.lib $(LIBDIR)\sc_torq.lib
  253. LIB $(OBJS) /OUT:$@
  254. LIB $@ $(LIBDIR)\s_tm1.lib /OUT:$@
  255. LIB $@ $(LIBDIR)\sc_tm20.lib /OUT:$@
  256. LIB $@ $(LIBDIR)\s_tmrt.lib /OUT:$@
  257. LIB $@ $(LIBDIR)\sc_torq.lib /OUT:$@
  258. copy $@ $(LIBDIR)