home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / bh.mak < prev    next >
Text File  |  1998-04-25  |  12KB  |  411 lines

  1.  
  2. #==============================================================================
  3. #   Microsoft (R) Bloodhound (tm).
  4. #
  5. #   MODULE: bh.mak
  6. #
  7. #   Modification History
  8. #
  9. #   raypa                11/17/92        Created for Win32.
  10. #   Tom MCConnell        02/04/93        Made it based on ntwin32.mak for portibility
  11. #   raypa                02/12/93        Added BHDLL_LIBS macro.
  12. #   Tom Laird-McConnell  11/15/93        Changed to use subsystem:native
  13. #   Tom Laird-McConnell  11/17/93        Added Splitsym stuff
  14. #   raypa                12/06/93        Partially rewrote for MIPS and ALPHA.
  15. #   raypa                12/06/93        No longer include WIN32.MAK.
  16. #   Tom Laird-McConnell  07/25/94        Rewrote to base it on ntwin32.mak for portibility
  17. #==============================================================================
  18.  
  19. !include <ntwin32.mak>
  20.  
  21. #==============================================================================
  22. #   This section verifies Bloodhound Build environment variables
  23. #==============================================================================
  24. !IFNDEF BH_ROOT
  25. !ERROR BH_ROOT must be set to the root of the Bloodhound tree
  26. !ENDIF
  27.  
  28. !IFNDEF BASEDIR
  29. !ERROR BASEDIR must be set to the root of the DDK tree
  30. !ENDIF
  31.  
  32. !IFNDEF CPU
  33. !ERROR CPU must be set to a valid cpu (such as i386, MIPS, ALPHA)
  34. !ENDIF
  35.  
  36. !IFNDEF BHVER
  37. !ERROR BHVER must be set to the name of the build
  38. !ENDIF
  39.  
  40. !IF "$(CPU)" == "i386"
  41. !IFNDEF WIN4DDK
  42. !ERROR WIN4DDK must be set to the root of the Win4 (Chicago) DDK directory
  43. !ENDIF
  44. !ENDIF
  45.  
  46. !IFNDEF TOOLS_TYPE
  47. !ERROR TOOLS_TYPE must be set to MSTOOLS or MSVC as appropriate
  48. !ENDIF
  49.  
  50. #==============================================================================
  51. #   The following macros makes it easier to get at files in the tree.
  52. #==============================================================================
  53.  
  54. BH_BUILD        = $(BH_ROOT)\build
  55. BH_INCL         = $(BH_ROOT)\include
  56. BH_BIN          = $(BH_ROOT)\bin
  57. BH_LIB          = $(BH_ROOT)\lib
  58.  
  59. !IFDEF NT_528
  60. BH_NTDDK        = $(BASEDIR)
  61. !ELSE
  62. BH_NTDDK        = $(BH_BASEDIR)
  63. !ENDIF
  64.  
  65. #==============================================================================
  66. #   The following are macros around the actual build tools.
  67. #==============================================================================
  68.  
  69. library         = lib
  70. implib          = lib
  71. mapsym          = $(BH_BIN)\i386\mapsympe
  72. LODCTR          = $(BH_BIN)\$(CPU)\lodctr.exe
  73. UNLODCTR        = $(BH_BIN)\$(CPU)\unlodctr.exe
  74.  
  75. # these should be defined in ntwin32.mak
  76. #link            = link
  77. #rc              = rc
  78. #cvtres          = cvtres
  79. #hc              = hc
  80. #mc              = mc
  81.  
  82. #==============================================================================
  83. #   Our build environment dependent stuff
  84. #==============================================================================
  85. !IF "$(TOOLS_TYPE)" == "MSTOOLS"
  86. CRTDLL_LIB = msvcrt.lib
  87. !ELSE
  88. #CRTDLL_LIB = MSVCRT.LIB
  89. #stevehi: for 10a, force it to be crtdll.lib
  90. CRTDLL_LIB = msvcrt.lib
  91. !ENDIF
  92.  
  93. !IF DEFINED(LEGO) || DEFINED(FULLEGO)
  94. !IF "$(TOOLS_TYPE)" == "MSTOOLS"
  95. !ERROR You must use MSVC 2.0 for LEGO
  96. !ENDIF
  97. !IFNDEF NODEBUG
  98. !ERROR You must define NODEBUG for LEGO
  99. !ENDIF
  100. !ENDIF
  101.  
  102. #==============================================================================
  103. #   NDIS 3.0 driver for Windows NT
  104. #==============================================================================
  105.  
  106. DRIVER_INCLUDES       = -I$(BH_ROOT)\include \
  107.                         -I$(BH_NTDDK)\inc \
  108.                         -I$(BH_NTDDK)\src\network\inc \
  109.                         -I$(BH_NTDDK)\private\ntos\inc \
  110.                         -I$(BH_NTDDK)\public\sdk\inc
  111.  
  112. DRIVER_COMMON_DEFINES = -DNDIS_NT \
  113.                         -DCONDITION_HANDLING=1 \
  114.                         -DWIN32_LEAN_AND_MEAN=1 \
  115.                         -DNT_UP=1 \
  116.                         -DNT_INST=0 \
  117.                         -D_IDWBUILD \
  118. !IFNDEF NODEBUG
  119.                         -DDBG=1 \
  120. !ELSE
  121.                         -DDBG=0 \
  122. !ENDIF
  123.                         -DDEVL=1 \
  124.                         -DNOFIREWALLS
  125.  
  126. !IFNDEF NODEBUG
  127. DRIVER_DEBUG    = -DDEBUG
  128. !ELSE
  129. DRIVER_DEBUG    =
  130. !ENDIF
  131.  
  132. DRIVER_PAGE_FLAG     = -DPAGED_CODE_ENABLED
  133.  
  134. DRIVER_COMMON_CFLAGS = -DMSINTERNAL -D_NTSDK $(DRIVER_PAGE_FLAG)
  135.  
  136. #==============================================================================
  137. #   The following section handles Intel processor-dependent definitions.
  138. #==============================================================================
  139.  
  140. !IF "$(CPU)" == "i386"
  141.  
  142. # we always want symbols on i386 builds
  143. BUILD_SYMBOLS   = YES
  144.  
  145. BH_CPU          = -D_X86_=1
  146.  
  147. # Optional CFLAG overides for this platform
  148. !IF "$(TOOLS_TYPE)" == "MSTOOLS"
  149. # BUGBUG: With cl386 Version 8.0.3190a the optimizations in the compiler have bugs
  150. # which break our code...we should try turning optimizations back on with a new compiler
  151. # We assume that MSTOOLS is old compiler and VC20 is new compiler, and so override the
  152. # optimization flags given us by NTWIN32.MAK
  153. BH_OPTCFLAGS = -Od -Z7
  154. !ELSE
  155. BH_OPTCFLAGS = -Od -Z7
  156. !ENDIF
  157.  
  158. #
  159. # Platform dependent Driver defines
  160. #
  161. !IFDEF NT_528
  162. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\i386\free
  163. !ELSE
  164. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\i386
  165. !ENDIF
  166.  
  167. !IFDEF NTBUILD_TREE 
  168. NTDDK_LIBPATH   = $(BH_NTDDK)\public\sdk\lib\i386
  169. !ENDIF
  170.  
  171. DRIVER_ENTRY    = DriverEntry@8
  172. DRIVER_DEFINES  = $(DRIVER_COMMON_DEFINES) $(DRIVER_DEBUG) -D_X86_=1 -Di386=1 -DSTD_CALL
  173. DRIVER_CFLAGS   = $(DRIVER_COMMON_CFLAGS) $(DRIVER_INCLUDES) $(DRIVER_DEFINES) -nologo -c -Zel -Zp8 -W3 -Gz -H63 -G4 -Ogitb1
  174. DRIVER_LIBS     = $(NTDDK_LIBPATH)\ntoskrnl.lib \
  175.                   $(NTDDK_LIBPATH)\libcntpr.lib \
  176.                   $(NTDDK_LIBPATH)\hal.lib \
  177.                   $(NTDDK_LIBPATH)\ndis.lib
  178.  
  179. #
  180. # LEGO STUFF
  181. #
  182. !IF DEFINED(LEGO) || DEFINED(FULLLEGO)
  183. path=$(BH_ROOT)\lego\tools\x86;$(PATH)
  184. !ENDIF
  185.  
  186. !IF DEFINED(FULLEGO)
  187. Lib=$(BH_ROOT)\lego\msvc20.lib\x86;$(LIB)
  188. !ENDIF
  189.  
  190. !ENDIF
  191.  
  192. #==============================================================================
  193. #   The following section handles Mips processor-dependent definitions.
  194. #==============================================================================
  195.  
  196. !IF "$(CPU)" == "MIPS"
  197.  
  198. BH_CPU          = -D_MIPS_=1
  199.  
  200. # Optional CFLAG overides for this platform
  201. BH_OPTCFLAGS = -Z7
  202.  
  203. #
  204. # Platform dependent Driver defines
  205. #
  206. !IFDEF NT_528
  207. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\mips\free
  208. !ELSE
  209. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\mips
  210. !ENDIF
  211.  
  212. DRIVER_ENTRY    = DriverEntry
  213. DRIVER_DEFINES  = $(DRIVER_COMMON_DEFINES) $(DRIVER_DEBUG) -DMIPS=1 -D_MIPS_=1 -DNO_EXT_KEYS -DMIPSEL -DR4000 -D_M_MRX000=4000 -DBETA=0 -D__stdcall= -D__cdecl=
  214. DRIVER_CFLAGS   = $(DRIVER_COMMON_CFLAGS) $(DRIVER_INCLUDES) $(DRIVER_DEFINES) -nologo -c -W3 -Ox -QmipsOb2000 -Gt0
  215. DRIVER_LIBS     = $(NTDDK_LIBPATH)\ntoskrnl.lib $(NTDDK_LIBPATH)\hal.lib $(NTDDK_LIBPATH)\ndis.lib
  216.  
  217. #
  218. # LEGO STUFF
  219. #
  220. !IF DEFINED(LEGO) || DEFINED(FULLLEGO)
  221. !ERROR Lego is only valid for x86
  222. !ENDIF
  223.  
  224. !ENDIF
  225.  
  226. #==============================================================================
  227. #   The following section handles Mips processor-dependent definitions.
  228. #==============================================================================
  229.  
  230. !IF "$(CPU)" == "PPC"
  231.  
  232. BH_CPU          = -D_PPC_=1
  233.  
  234. # Optional CFLAG overides for this platform
  235. BH_OPTCFLAGS = -Z7
  236.  
  237. #
  238. # Platform dependent Driver defines
  239. #
  240. !IFDEF NT_528
  241. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\ppc\free
  242. !ELSE
  243. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\ppc
  244. !ENDIF
  245.  
  246. !IFDEF NTBUILD_TREE
  247. NTDDK_LIBPATH    = $(BH_NTDDK)\public\sdk\lib\ppc
  248. !ENDIF
  249.  
  250.  
  251. DRIVER_ENTRY    = DriverEntry
  252. DRIVER_DEFINES  = $(DRIVER_COMMON_DEFINES) $(DRIVER_DEBUG) -DPPC=1 -D_PPC_=1 -DNO_EXT_KEYS -DBETA=0 -D__stdcall= -D__cdecl=
  253. DRIVER_CFLAGS   = $(DRIVER_COMMON_CFLAGS) $(DRIVER_INCLUDES) $(DRIVER_DEFINES) -nologo -c -W3 -Ox
  254. DRIVER_LIBS     = $(NTDDK_LIBPATH)\ntoskrnl.lib $(NTDDK_LIBPATH)\hal.lib $(NTDDK_LIBPATH)\ndis.lib
  255.  
  256. #
  257. # LEGO STUFF
  258. #
  259. !IF DEFINED(LEGO) || DEFINED(FULLLEGO)
  260. !ERROR Lego is only valid for x86
  261. !ENDIF
  262.  
  263. !ENDIF
  264.  
  265. #==============================================================================
  266. #   The following section handles ALPHA processor-dependent definitions.
  267. #==============================================================================
  268.  
  269. !IF "$(CPU)" == "ALPHA"
  270.  
  271. BH_CPU          = -D_ALPHA_=1
  272.  
  273. # Optional CFLAG overides for this platform
  274. BH_OPTCFLAGS = -Z7
  275.  
  276. #
  277. # Platform dependent Driver defines
  278. #
  279. !IFDEF NT_528
  280. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\alpha\free
  281. !ELSE
  282. NTDDK_LIBPATH   = $(BH_NTDDK)\lib\alpha
  283. !ENDIF
  284.  
  285. DRIVER_ENTRY    = DriverEntry
  286. DRIVER_DEFINES  = $(DRIVER_DEBUG) -DALPHA=1 -D_ALPHA_=1 -DNO_EXT_KEYS -DWIN32_LEAN_AND_MEAN=1 \
  287.                   -DCONDITION_HANDLING=1 -DNT_INST=0 -DNT_UP=1 -DDBG=0 -DDEVL=1 -DBETA=0 \
  288.                   -DNOFIREWALLS -D__stdcall= -D_cdecl= -D__cdecl= -Dcdecl=
  289.  
  290. DRIVER_CFLAGS   = $(DRIVER_COMMON_CFLAGS) $(DRIVER_INCLUDES) $(DRIVER_DEFINES) -nologo /c /W3 /Ox -d2"switch no*check*" -d2"switch mscdev"
  291.  
  292. DRIVER_LIBS     = $(NTDDK_LIBPATH)\ntoskrnl.lib \
  293.                   $(NTDDK_LIBPATH)\libcntpr.lib \
  294.                   $(NTDDK_LIBPATH)\hal.lib \
  295.                   $(NTDDK_LIBPATH)\ndis.lib
  296.  
  297. #
  298. # LEGO STUFF
  299. #
  300. !IF DEFINED(LEGO) || DEFINED(FULLLEGO)
  301. !ERROR Lego is only valid for x86
  302. !ENDIF
  303.  
  304. !ENDIF
  305.  
  306. #==============================================================================
  307. #   No processor type has been defined.
  308. #==============================================================================
  309.  
  310. !IFNDEF CPU
  311. !ERROR  Must specify CPU environment variable (CPU=i386 or CPU=MIPS)!
  312. !ENDIF
  313.  
  314. #==============================================================================
  315. #   Common macros for Bloodhound projects.
  316. #==============================================================================
  317.  
  318. !IFNDEF NODEBUG
  319.  
  320. CHECKMEM        = 1
  321. DOCHECKMEM      = -DCHECKMEM
  322. BH_CDEBUG       = $(cdebug) -DDEBUG
  323.  
  324. !ELSE
  325.  
  326. CHECKMEM        =
  327. DOCHECKMEM      =
  328. BH_CDEBUG       = $(cdebug)
  329.  
  330. !ENDIF
  331.  
  332. #
  333. # optional debug flags, particularly for LEGO
  334. #
  335. !IF !DEFINED(LEGO) && !DEFINED(FULLLEGO)
  336. # this is the normal ntwin32.mak debug flags, with symbol generation
  337. # always turned on
  338. BH_LDEBUG       = $(ldebug) -debug:full -debugtype:both
  339. !ELSE
  340. # these are the LEGO flags
  341. BH_LDEBUG       = -debug -debugtype:both,fixup /opt:ref
  342. BH_CDEBUG       = $(BH_CDEBUG) -Gy
  343. !ENDIF
  344.  
  345. BH_SUBSYSTEM    = WINDOWS
  346.  
  347. #
  348. # Compiler FLAGS
  349. #
  350. # Note we override to always generate symbolic information, as we always use splitsym
  351. # and we optional override with BH_OPFLAGS for optimization bugs in compilers
  352. #
  353. BH_CFLAGS       = $(cflags) $(cvarsdll) $(BH_CDEBUG) $(BH_OPTCFLAGS) \
  354. !IFNDEF SMS
  355.                   -DNTAS_ONLY \
  356. !ENDIF
  357.                   -D_NTSDK -nologo -WX -I$(BH_INCL)
  358. #                  -D_NTSDK -nologo     -I$(BH_INCL)
  359.  
  360. #
  361. # LINK FLAGS
  362. #
  363. BH_LFLAGS       = $(lflags) $(BH_LDEBUG) -machine:$(CPU) -MAP:$*.map
  364.  
  365. #
  366. # Lib Flags
  367. #
  368. BH_LIBFLAGS     = -machine:$(CPU)
  369.  
  370. #
  371. # DLL Link Flags
  372. #
  373. BHDLL_LFLAGS    = $(BH_LFLAGS) -entry:DLLEntry$(DLLENTRY) -dll
  374.  
  375. #
  376. # Executable Libraries
  377. #
  378. BH_LIBS          = $(CRTDLL_LIB) $(winlibs)
  379. #stevehi force crtdll instead of msvcrt.dll
  380. #BH_LIBS = $(guilibsdll)
  381.  
  382. #
  383. # DLL Libraries
  384. #
  385. #BHDLL_LIBS      = $(guilibsdll)
  386. # stevehi force crtdll instead of msvcrt.dll
  387. BHDLL_LIBS          = $(CRTDLL_LIB) $(winlibs)
  388.  
  389. BH_LIBS          = $(BH_LIBS) $(BH_BUILD)\dbcs.lib
  390. BHDLL_LIBS      = $(BHDLL_LIBS) $(BH_BUILD)\dbcs.lib
  391.  
  392.  
  393. DRIVER_LFLAGS   = -out:nt\bhnt.sys \
  394.                   -debug:MINIMAL \
  395.                   -debugtype:coff \
  396.                   -machine:$(CPU) \
  397.                   -align:0x200 \
  398.                   -subsystem:native \
  399.                   -debug:notmapped \
  400.                   -debugtype:coff \
  401.                   -base:0x10000 \
  402.                   -entry:$(DRIVER_ENTRY)
  403.  
  404. BH_COMMON       = $(BH_INCL)\nal.h \
  405.                   $(BH_INCL)\bh.h \
  406.                   $(BH_INCL)\bhtypes.h \
  407.                   $(BH_INCL)\buffer.h \
  408.                   $(BH_INCL)\frame.h \
  409.                   $(BH_INCL)\parser.h \
  410.                   $(BH_INCL)\bherr.h
  411.