home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / usbd0906.zip / usb_20020906.zip / usbcalls / makefile next >
Makefile  |  2001-11-13  |  7KB  |  220 lines

  1. #
  2. # makefile:
  3. #       makefile for USBCALLS DLL
  4. #       For use with IBM NMAKE, which comes with the IBM compilers,
  5. #       the Developer's Toolkit, and the DDK.
  6. #
  7. #       This compiles the usbcalls DLL Ring3 interface for USB devices
  8. #
  9. #       Notes:
  10. #
  11. #       1)
  12. #
  13. #
  14. #       Input:          ./*.cpp
  15. #
  16. #       Output:         ./DLL/*.obj
  17. #
  18. #
  19.  
  20. # COMPILER OPTIONS
  21. # ----------------
  22.  
  23. TKBASE=f:\toolkit
  24. VACBASE=f:\IBMCPP
  25.  
  26. # Compiler macro. This is used for each .OBJ file to be created.
  27. # If the XWP_DEBUG environment variable was set to anything, we
  28. # will use debugging compiler options.
  29. # XWP_DEBUG is set by MAKE.CMD or above.
  30. #
  31. # No need to change this. Change the variables above instead.
  32.  
  33. CC = error_in_makefile_do_not_use_CC_directly
  34.  
  35. # CC_WARNINGS  = /w3 /Wcmp+ /Wcnd- /Wcns+ /Wcnv+ /Wgen /Wcns /Wcpy /Wobs /Word- /Wpro /Wrea /Wret /Wtru
  36. CC_WARNINGS  = /w3 /Wcmp+ /Wcnd- /Wcns+ /Wcnv+ /Wgen /Wcns /Wcpy /Wobs /Word- /Wpro /Wrea /Wret /Wtru
  37. # /Wuse+ /Wuni+
  38.  
  39. # compiler options which are the same with debug and release code
  40. CC_SHARED    = /c /gd- /gi+ /q /se /ss+ /g5
  41.  
  42. !ifdef DEBUG
  43. # debug code
  44. CC_TEMP      = $(CC_SHARED) /o- /oi- /ol- /ti+ /D__DEBUG__=1
  45. # /tm+
  46. !else
  47. # release code
  48. CC_TEMP      = $(CC_SHARED) /o+ /oi- /ol- /tn+
  49. !endif
  50.  
  51. # DLL code (multi-threaded)
  52. CC_DLL_MT = $(CC_TEMP) /ge- /gm+
  53. #$(CC_WARNINGS)
  54. # DLL code (single-threaded, subsystem libraries)
  55. CC_DLL_SUBSYS = $(CC_TEMP) /ge- /rn $(CC_WARNINGS)
  56. # EXE code (multi-threaded)
  57. CC_EXE_MT = $(CC_TEMP) /ge+ /gm+ $(CC_WARNINGS)
  58. # EXE code (single-threaded)
  59. CC_EXE_ST = $(CC_TEMP) /ge+ /gm- $(CC_WARNINGS)
  60.  
  61. # Some VisualAge C++ compiler options explained [default in brackets]:
  62. # /c:   compile only, no link (we'll call the linker explicitly)
  63. # /fi+: precompile header files                         [/fe-]
  64. # /g3|4|5: optimize for 386/486/Pentium                 [/g3]
  65. # /gd-: link runtime statically                         [/gd-]
  66. # /ge-: create DLL code                                 [/ge+]
  67. #           This switches between EXE and DLL initialization code
  68. #           for the .OBJ file. /ge+ is only needed when the object
  69. #           file contains a main() function. For libraries to be
  70. #           used either with EXE's or DLL's, use /ge+.
  71. # /gh+: generate profiling hooks for VAC profiler
  72. # /gi+: fast integer execution
  73. # /Gl+: remove unreferenced functions (when comp.+link in 1 step)
  74. # /gm+: multithread libraries
  75. # /gm+: disable stack probes (single-thread only!)
  76. # /kc+: produce preprocessor warnings
  77. # /o+:  optimization (inlining etc.)
  78. # /oi-: no inlining (?)
  79. # /ol+: use intermediate linker; do _not_ use with debug code
  80. # /q+:  suppress icc logo
  81. # /Re : don't use subsystem libraries (!= Rn)
  82. # /se:  all language extensions
  83. # /si+: allow use of precompiled header files
  84. # /ss:  allow double slashes comments in C too
  85. # /ti+: debug code
  86. # /tdp: compile everything as C++, even if it has a .C suffix
  87. # /tm:  use debug memory management (malloc etc.)
  88. # /tn:  add source line numbers to object files (for mapfile); a subset of /ti+
  89. # /Wcls: class problems
  90. # /Wcnd: conditional exprs problems (= / == etc.)
  91. # /Wcmp: possible unsigned comparison redundancies
  92. # /Wcns: operations involving constants
  93. # /Wcnv: conversions
  94. # /Wcpy: copy constructor problems
  95. # /Weff: statements with no effect (annoying)
  96. # /Wgen: generic debugging msgs
  97. # /Wobs: obsolete features
  98. # /Word: unspecified evaluation order
  99. # /Wpar: list non-referenced parameters (annoying)
  100. # /Wppc: list possible preprocessor problems (.h dependencies)
  101. # /Wpro: warn if funcs have not been prototyped
  102. # /Wrea: mark code that cannot be reached
  103. # /Wret: check consistency of return levels
  104. # /Wuni: uninitialized variables
  105. # /Wuse: unused variables
  106. # /w2:   produce error and warning messages, but no infos
  107.  
  108.  
  109. # LINK OPTIONS
  110. # ------------
  111. #
  112. # Link macro. This is used for final linking.
  113. # If we're supposed to do the release version, we'll turn
  114. # off debugging and optimize and pack the resulting files.
  115. #
  116. # No need to change this. Change the variables above instead.
  117.  
  118. LIBDIRS = $(TKBASE)\lib\ $(TKBASE)\SOM\LIB\ "$(VACBASE)\lib\"
  119.  
  120. LINK_BASE = ilink /nologo /noe /map /linenumbers $(LIBDIRS)
  121.  
  122. !ifdef DEBUG
  123. LINK =  $(LINK_BASE) /debug
  124. LINK_ALWAYSPACK = $(LINK_BASE) /exepack:2
  125. !else
  126. LINK =  $(LINK_BASE) /exepack:2
  127. LINK_ALWAYSPACK = $(LINK)
  128. #/packcode /packdata
  129. # /optfunc
  130. !endif
  131.  
  132. # Some LINK386 cmd line options
  133. # (Visual Age ILINK understands these too if /nofree is specified):
  134. # /align:  executable pages align factor (in bytes)
  135. # /noe:    no extended dictionary. Required for replacing _DLL_InitTerm.
  136. #          Can slightly increase executable's size.
  137. # /noi:    no ignore case (necc. for C)
  138. # /map:    list public symbols (create MAP file); we always need this,
  139. #          because we produce a .SYM file later.
  140. # /linenumbers: include linenumbers in MAP file
  141. # /nod:    no default library search (explicitly specify libs)
  142. # /nol:    no logo (link386 startup)
  143. # /packcode: group neighboring code segments (enabled per default)
  144. # /packdata: group neighboring data segments (disabled per default)
  145. # /debug:  include debug code
  146. # /optfunc: optimize code arrangement (takes some extra time)
  147. # /exepack:2 use Warp 3 executable compression
  148.  
  149.  
  150. # RESOURCE COMPILER
  151. # -----------------
  152.  
  153. RC      = rc -p -x2 -n -i $(TKBASE)\h -i $(PROJECT_BASE_DIR)\include
  154.  
  155. # RC options:
  156. # -p       pack (64K boundaries)
  157. # -x2      Warp 3 compression
  158. # -n       no logo
  159.  
  160.  
  161.  
  162.  
  163. # FIXED MACROS
  164. # ------------
  165. #
  166. # You probably need not change the following.
  167. #
  168.  
  169. # Define the suffixes for files which NMAKE will work on.
  170. # .SUFFIXES is a reserved NMAKE keyword ("pseudotarget") for
  171. # defining file extensions that NMAKE will recognize in inference
  172. # rules.
  173.  
  174. .SUFFIXES: .cpp .obj .dll .h .ih .rc .res
  175.  
  176. # OUTPUTDIR specifies the directory where all the output .OBJ
  177. # 1) all build files are in a common dir tree and the entire
  178. #    tree can be removed completely;
  179. # 2) the build tree can be on a different physical drive for
  180. #    speed.
  181. OUTPUTDIR = .\DLL
  182. !if [@echo       OUTPUTDIR is $(OUTPUTDIR)]
  183. !endif
  184.  
  185. # create output directory
  186. !if [@md $(OUTPUTDIR) 2> NUL]
  187. !endif
  188.  
  189. {.\}.cpp{$(OUTPUTDIR)\}.obj:
  190.     icc $(CC_DLL_MT) -Fo$(OUTPUTDIR)\$(@B).obj -c    $<
  191.  
  192.  
  193.  
  194.  
  195. # The OBJS macro contains all the .OBJ files which need to be
  196. # created from the files in this directory.
  197. # These will be put into BIN\.
  198. # If you add a new source, add the corresponding .OBJ file here.
  199. OBJS = \
  200. $(OUTPUTDIR)\usbcalls.obj \
  201. $(OUTPUTDIR)\usbrexx.obj
  202.  
  203. #    $(OUTPUTDIR)\usblink.obj
  204. #    $(OUTPUTDIR)\testio.obj
  205. #    $(OUTPUTDIR)\testide2.obj
  206. #    $(OUTPUTDIR)\testbulk.obj
  207.  
  208.  
  209.  
  210. $(OUTPUTDIR)\USBCALLS.DLL: $(OBJS)
  211. #all:
  212.   $(LINK) /DLL $(OUTPUTDIR)\usbcalls.obj $(OUTPUTDIR)\usbrexx.obj \
  213.    $(TKBASE)\lib\REXX.LIB \
  214.     usbcalls.def /O:$(OUTPUTDIR)\usbcalls.dll
  215.   IMPLIB .\LIB\USBCALLS.LIB .\DLL\USBCALLS.DLL
  216.  
  217.  
  218.  
  219.  
  220.