home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / setup.in < prev    next >
Text File  |  2002-07-28  |  15KB  |  470 lines

  1.  
  2. #
  3. # setup.in:
  4. #       this is included from all makefiles in the subdirectories
  5. #       (via the NMAKE !INCLUDE directive) to set up variables
  6. #       common to all makefiles, such as compiler options and
  7. #       directory specifications.
  8. #
  9. #       Starting with V0.9.12, this includes config.in in turn,
  10. #       which only contains system-specific variables.
  11. #
  12. #       As a result, there is NORMALLY NO NEED to modify this
  13. #       file. Modify config.in instead.
  14. #
  15. #       After including this file, the makefiles can use the following
  16. #       macros, which will all be properly set for debug or non-debug mode
  17. #       and with the include directories set properly:
  18. #
  19. #           $(CC_DLL_MT)    compile DLL code (multi-threaded)
  20. #           $(CC_DLL_SUBSYS compile DLL code (single-threaded, subsystem libraries)
  21. #           $(CC_EXE_MT)    compile EXE code (multi-threaded)
  22. #           $(CC_EXE_ST)    compile EXE code (single-threaded)
  23. #
  24. #           $(LINK)      call linker (ILINK.EXE per default)
  25. #
  26. #           $(RC)        call resource compiler
  27. #
  28. #       In addition, the following variables will be set to
  29. #       values that will be useful for the makefiles:
  30. #
  31. #           $(PROJECT_BASE_DIR)     root directory of the local
  32. #                                   XWorkplace repository, e.g.
  33. #                                   "K:\cvs\xworkplace"
  34. #
  35. #           $(HELPERS_BASE)         root directory of the local
  36. #                                   xwphelpers repository, e.g.
  37. #                                   "K:\cvs\xwphelpers"
  38. #
  39. #           $(XWP_OUTPUT_ROOT)      directory where to place output
  40. #                                   files in, e.g.
  41. #                                   "K:\cvs\xworkplace\bin"
  42. #
  43. #           $(MODULESDIR)           modules subdirectory of the above, e.g.
  44. #                                   "K:\cvs\xworkplace\bin\modules"
  45. #
  46. #           $(XWP_LANG_CODE)        language code that is being built, e.g.
  47. #                                   "001"
  48. #
  49.  
  50. !include config.in
  51.  
  52. # set up PROJECT_BASE_DIR, which is required by other
  53. # makefiles (and most importantly by xwphelpers)
  54. PROJECT_BASE_DIR = $(CVS_WORK_ROOT)\$(XWPDIR)
  55. # this should give us something like K:\cvs\xworkplace
  56.  
  57.  
  58. # OUTPUT DIRECTORIES
  59. # ------------------
  60.  
  61. # Unless you have specified an explicit path in
  62. # XWP_OUTPUT_ROOT from the environment, this
  63. # defaults to the bin\ subdir.
  64.  
  65. !ifndef XWP_OUTPUT_ROOT
  66. XWP_OUTPUT_ROOT = $(PROJECT_BASE_DIR)\bin
  67. !endif
  68.  
  69. PROJECT_OUTPUT_DIR = $(XWP_OUTPUT_ROOT)
  70.  
  71. # HELPERS_OUTPUT_DIR is where the xwphelpers
  72. # will write stuff to.
  73. HELPERS_OUTPUT_DIR = $(PROJECT_OUTPUT_DIR)
  74.  
  75. # MODULESDIR is used for mapfiles and final module (DLL, EXE) output.
  76. # PROJECT_OUTPUT_DIR has been set by setup.in based on the environment.
  77. MODULESDIR=$(PROJECT_OUTPUT_DIR)\modules
  78. #!if [@echo ---^> MODULESDIR is $(MODULESDIR)]
  79. #!endif
  80.  
  81. #!ifdef XWP_DEBUG
  82. #!if [@echo ---^> Debug build has been enabled.]
  83. #!endif
  84. #!else
  85. #!if [@echo ---^> Building release code (debugging disabled).]
  86. #!endif
  87. #!endif
  88.  
  89. # create output directory
  90. !if [@md $(PROJECT_OUTPUT_DIR) 2> NUL]
  91. !endif
  92. !if [@md $(MODULESDIR) 2> NUL]
  93. !endif
  94.  
  95. !ifndef XWPRUNNING
  96. !error in setup.in: You must set XWPRUNNING to an existing XWorkplace binary installation. See PROGREF.INF for details.
  97. !endif
  98.  
  99.  
  100. # DYNAMIC TRACE
  101. # -------------
  102.  
  103. # If DYNAMIC_TRACE is set to your boot drive letter, we will
  104. # automatically generate TSF, TDF, and TFF files for the OS/2
  105. # TRACE facility and the trace formatter (TRACEFMT.EXE). The
  106. # TFF file will then be copied to $(DYNAMIC_TRACE):\os2\system\trace,
  107. # the TDF file will be copied to $(XWPRUNNING)\bin (where XFLDR.DLL
  108. # is also copied to).
  109. #
  110. # Note: This has only been tested with the most recent enhancements
  111. # to the trace facility (Warp 4 FP 10 or later). Comment out the
  112. # following statement if you run into trouble. Also, this takes
  113. # quite a bit of time at compile time and slows down execution also.
  114.  
  115. # DYNAMIC_TRACE=F
  116.  
  117.  
  118. # NATIONAL LANGUAGE SUPPORT
  119. # -------------------------
  120.  
  121. !ifndef XWP_LANG_CODE
  122. XWP_LANG_CODE = 001
  123. !endif
  124.  
  125.  
  126. # XWORKPLACE RELEASE
  127. # ------------------
  128.  
  129. # XWPRELEASE must specify the path of where to create an
  130. # XWorkplace release tree, which can easily be turned into
  131. # a WarpIN archive (.WPI file). This is only used with
  132. # an explicit "nmake release".
  133.  
  134. !ifndef XWPRELEASE
  135. XWPRELEASE = K:\projects\distrib\XWorkplace\current
  136. !endif
  137.  
  138. # produce subdirectories
  139.  
  140. XWPRELEASE_MAIN = $(XWPRELEASE)\kernel
  141. XWPRELEASE_HEALTH = $(XWPRELEASE)\health
  142. XWPRELEASE_NLS = $(XWPRELEASE)\$(XWP_LANG_CODE)
  143. XWPRELEASE_NLSDOC = $(XWPRELEASE)\inf$(XWP_LANG_CODE)
  144. XWPRELEASE_MAP = $(XWPRELEASE)\map
  145.  
  146.  
  147. # HELPERS DIRECTORIES
  148. # -------------------
  149.  
  150. # XWorkplace uses lots of generic OS/2 helpers code, which
  151. # I have developed over time. Since this code is shared with
  152. # WarpIN and other projects might want to use it too, this
  153. # has been extracted to a separate CVS archive. We assume
  154. # it's in the CVS tree also, so we derive this from $(CVS_WORK_ROOT).
  155.  
  156. !ifndef HELPERS_BASE
  157. HELPERS_BASE = $(CVS_WORK_ROOT)\$(XWPHELPERSDIR)
  158. !endif
  159.  
  160. !ifdef XWP_DEBUG
  161. PMPRINTF_LIB = $(HELPERS_BASE)\src\helpers\pmprintf.lib
  162. !else
  163. PMPRINTF_LIB =
  164. !endif
  165.  
  166.  
  167. # PRECOMPILED HEADERS
  168. # -------------------
  169.  
  170. # The following is the directory for precompiled header files.
  171. # This is a feature of VAC++ 3.0 to speed up compilation.
  172. #
  173. # If the PRECH variable is defined (which should point to a
  174. # valid directory), precompiled headers will automatically be
  175. # enabled for all compilations. This dramatically speeds up
  176. # repetitive compilations (up to three times, especially with
  177. # the extremely complex SOM header files).
  178. #
  179. # If the PRECH variable is not defined, precompiled header files
  180. # will not be used. Uncomment the below statement if you have
  181. # trouble. This will work fine, but slower.
  182. #
  183. # I strongly recommend using a RAM disk for this. This makes sure
  184. # that the prech's won't use space on your disks forever.
  185. # I use RAMFS.IFS for the RAM disk, which is much more reliable
  186. # than OS/2's VDISK.SYS.
  187. # I have TEMP set to "R:\temp", which I create at each bootup
  188. # from CONFIG.SYS. VAC++ and the SOM compiler crash when specifying
  189. # a root directory (e.g. "R:\") as a temp/prech directory.
  190. #
  191. # Note that we create a _separate_ precompiled header file for each
  192. # source file (in the $(PRECH) directory). This eats up a lot
  193. # of space (I have about 70 MB after a complete XWorkplace build!!),
  194. # but makes sure that the precompiled header does not get recreated
  195. # for each source file, which is a lot faster.
  196. #
  197. # So be warned: if you have TEMP on a RAM disk, this better be
  198. # able to hold more than 30 MBs. If you're using a RAM disk, you
  199. # should have 128 MBs of RAM on your system, or otherwise you'll
  200. # only hear the swap file rattle.
  201. #
  202. # Here are compile times for "nmake -a compile" on the main makefile
  203. # (PII-400, 128 MB RAM, using RAMFS.IFS, code of 99-10-22):
  204. # -- without PRECH:     2:01 minutes
  205. # -- with PRECH:        1:08 minutes
  206. #
  207. # Decide for yourself. ;-)
  208.  
  209. PRECH = $(TEMP)
  210.  
  211.  
  212. # INCLUDES
  213. # --------
  214.  
  215. # Set the include path for the compiler.
  216. # This is only used from the subdirectories of SRC and TOOLS,
  217. # so the relative paths are relative to the respective
  218. # subdirectories (e.g. src\main, tools\strrpl).
  219. # We must include include\classes\ also because otherwise the
  220. # headers generated by the SOM compiler won't work.
  221. #
  222. # This does not modify INCLUDE, but defines a new variable,
  223. # which is passed to the compiler with the "CC" macros below.
  224. #
  225. # No need to change this. Change the variables above instead.
  226. #
  227.  
  228. !ifndef TKBASE
  229. !error TKBASE is not defined.
  230. !endif
  231.  
  232. INCLUDE_TEMP1=
  233. !ifdef DDKBASE
  234. INCLUDE_TEMP1=$(DDKBASE)\h;
  235. !endif
  236.  
  237. INCLUDE_TEMP2=
  238. !ifdef SESBASE
  239. # SES defined:
  240. INCLUDE_TEMP2=$(SESBASE)\h;
  241. !endif
  242.  
  243. INCLUDE_TEMP3=
  244. !ifdef LANHEADERS
  245. INCLUDE_TEMP3=$(LANHEADERS);
  246. !endif
  247.  
  248. LIBC_HEADERS = $(VACBASE)\include
  249.  
  250. PROJECT_INCLUDE = $(PROJECT_BASE_DIR)\include\classes\wps;$(TKBASE)\h;$(TKBASE)\som\include;$(INCLUDE_TEMP3)$(LIBC_HEADERS);$(PROJECT_BASE_DIR)\include;$(PROJECT_BASE_DIR)\include\classes;$(HELPERS_BASE)\include;$(INCLUDE_TEMP1)$(INCLUDE_TEMP2)
  251.  
  252.  
  253. # TOOLS SETUP
  254. # -----------
  255.  
  256. RUN_FASTDEP = $(HELPERS_BASE)\fastdep.exe -i .;$(PROJECT_INCLUDE) -o $(OUTPUTDIR)
  257.  
  258. RUN_BLDLEVEL = cmd.exe /c $(CVS_WORK_ROOT)\$(XWPDIR)\tools\BuildLevel.cmd
  259.  
  260. RUN_UNLOCK = $(CVS_WORK_ROOT)\$(XWPDIR)\tools\unlock.exe
  261.  
  262. RUN_STRRPL = $(HELPERS_BASE)\strrpl.exe
  263.  
  264. RUN_DCD = $(CVS_WORK_ROOT)\$(XWPDIR)\tools\dcd.cmd
  265.  
  266. !ifndef ENTITYDEFS
  267. !ifdef XWPLITE
  268. ENTITYDEFS = entities_lite.h
  269. !else
  270. ENTITYDEFS = entities.h
  271. !endif
  272. !endif
  273.  
  274. !ifdef XWPLITE
  275. XWPNAME = eWorkplace
  276. !else
  277. XWPNAME = XWorkplace
  278. !endif
  279.  
  280. !ifndef RUN_H2I
  281. RUN_H2I = $(HELPERS_BASE)\h2i.exe
  282. !endif
  283.  
  284. COPY = cmd.exe /c copy
  285.  
  286.  
  287. # INCLUDED FEATURES
  288. # -----------------
  289.  
  290. # All makefiles react to a number of "features" environment variables,
  291. # that is, certain features will only be compiled/linked when their
  292. # corresponding environment variable is defined. The convention is that
  293. # each of these environment variables will #define __VARNAME__ on the
  294. # compiler command line so that the code can be conditionally compiled.
  295.  
  296. ANIMATED_MOUSE_POINTERS_STRING =
  297. !ifdef ANIMATED_MOUSE_POINTERS
  298. ANIMATED_MOUSE_POINTERS_STRING = /D__ANIMATED_MOUSE_POINTERS__=1
  299. !endif
  300.  
  301. REPLHANDLES_STRING =
  302. !ifdef REPLHANDLES
  303. REPLHANDLES_STRING = -D__REPLHANDLES__=1
  304. !endif
  305.  
  306. XWPLITE_STRING =
  307. !ifdef XWPLITE
  308. XWPLITE_STRING = -D__XWPLITE__=1
  309. !endif
  310.  
  311. # COMPILER OPTIONS
  312. # ----------------
  313.  
  314. # Compiler macro. This is used for each .OBJ file to be created.
  315. # If the XWP_DEBUG environment variable was set to anything, we
  316. # will use debugging compiler options.
  317. # XWP_DEBUG is set by MAKE.CMD or above.
  318. #
  319. # No need to change this. Change the variables above instead.
  320.  
  321. CC = error_in_makefile_do_not_use_CC_directly
  322.  
  323. # CC_WARNINGS  = /w3 /Wcmp+ /Wcnd- /Wcns+ /Wcnv+ /Wgen /Wcns /Wcpy /Wobs /Word- /Wpro /Wrea /Wret /Wtru
  324. CC_WARNINGS  = /w3 /Wcmp+ /Wcnd- /Wcns+ /Wcnv+ /Wgen /Wcns /Wcpy /Wobs /Word- /Wpro /Wrea /Wret /Wtru
  325. # /Wuse+ /Wuni+
  326.  
  327. # compiler options which are the same with debug and release code
  328. CC_SHARED    = icc $(ANIMATED_MOUSE_POINTERS_STRING) \
  329. $(REPLHANDLES_STRING) \
  330. $(XWPLITE_STRING) \
  331. /I$(PROJECT_INCLUDE) /c /gd- /gi+ /q+ /se /ss /g5 \
  332. # /DTCPV40HDRS
  333. # V0.9.9 (2001-01-29) [umoeller]: added /g5, finally
  334.  
  335. !ifdef XWP_DEBUG
  336. # debug code
  337. # /tm+
  338. !ifdef ALLOW_INT3
  339. CC_INT3      = /D__INT3__=1
  340. !endif
  341. CC_TEMP      = $(CC_SHARED) /o- /oi- /ol- /ti+ /D__DEBUG__=1 $(CC_INT3)
  342. !else
  343. # release code
  344. CC_TEMP      = $(CC_SHARED) /o+ /oi- /ol- /tn+
  345. # V0.9.7 (2000-12-10) [umoeller]: added /tn+, or we won't get line numbers
  346. # in the map files for the release version...
  347. !endif
  348.  
  349. # DLL code (multi-threaded)
  350. CC_DLL_MT = $(CC_TEMP) /ge- /gm+ $(CC_WARNINGS)
  351. # DLL code (single-threaded, subsystem libraries)
  352. CC_DLL_SUBSYS = $(CC_TEMP) /ge- /rn $(CC_WARNINGS)
  353. # EXE code (multi-threaded)
  354. CC_EXE_MT = $(CC_TEMP) /ge+ /gm+ $(CC_WARNINGS)
  355. # EXE code (single-threaded)
  356. CC_EXE_ST = $(CC_TEMP) /ge+ /gm- $(CC_WARNINGS)
  357.  
  358. # compiler options for XWorkplace helpers;
  359. # these are passed to the XWPHelpers makefiles
  360. CC_HELPERS_EXE_MT = $(CC_EXE_MT)
  361. CC_HELPERS_DLL    = $(CC_DLL_MT)
  362.  
  363. # Some VisualAge C++ compiler options explained [default in brackets]:
  364. # /c:   compile only, no link (we'll call the linker explicitly)
  365. # /fi+: precompile header files                         [/fe-]
  366. # /g3|4|5: optimize for 386/486/Pentium                 [/g3]
  367. # /gd-: link runtime statically                         [/gd-]
  368. # /ge-: create DLL code                                 [/ge+]
  369. #           This switches between EXE and DLL initialization code
  370. #           for the .OBJ file. /ge+ is only needed when the object
  371. #           file contains a main() function. For libraries to be
  372. #           used either with EXE's or DLL's, use /ge+.
  373. # /gh+: generate profiling hooks for VAC profiler
  374. # /gi+: fast integer execution
  375. # /Gl+: remove unreferenced functions (when comp.+link in 1 step)
  376. # /gm+: multithread libraries
  377. # /gm+: disable stack probes (single-thread only!)
  378. # /kc+: produce preprocessor warnings
  379. # /o+:  optimization (inlining etc.)
  380. # /oi-: no inlining (?)
  381. # /ol+: use intermediate linker; do _not_ use with debug code
  382. # /q+:  suppress icc logo
  383. # /Re : don't use subsystem libraries (!= Rn)
  384. # /se:  all language extensions
  385. # /si+: allow use of precompiled header files
  386. # /ss:  allow double slashes comments in C too
  387. # /ti+: debug code
  388. # /tdp: compile everything as C++, even if it has a .C suffix
  389. # /tm:  use debug memory management (malloc etc.)
  390. # /tn:  add source line numbers to object files (for mapfile); a subset of /ti+
  391. # /Wcls: class problems
  392. # /Wcnd: conditional exprs problems (= / == etc.)
  393. # /Wcmp: possible unsigned comparison redundancies
  394. # /Wcns: operations involving constants
  395. # /Wcnv: conversions
  396. # /Wcpy: copy constructor problems
  397. # /Weff: statements with no effect (annoying)
  398. # /Wgen: generic debugging msgs
  399. # /Wobs: obsolete features
  400. # /Word: unspecified evaluation order
  401. # /Wpar: list non-referenced parameters (annoying)
  402. # /Wppc: list possible preprocessor problems (.h dependencies)
  403. # /Wpro: warn if funcs have not been prototyped
  404. # /Wrea: mark code that cannot be reached
  405. # /Wret: check consistency of return levels
  406. # /Wuni: uninitialized variables
  407. # /Wuse: unused variables
  408. # /w2:   produce error and warning messages, but no infos
  409.  
  410.  
  411. # LINK OPTIONS
  412. # ------------
  413. #
  414. # Link macro. This is used for final linking.
  415. # If we're supposed to do the release version, we'll turn
  416. # off debugging and optimize and pack the resulting files.
  417. #
  418. # No need to change this. Change the variables above instead.
  419.  
  420. LIBDIRS = $(TKBASE)\lib\ $(TKBASE)\SOM\LIB\ "$(VACBASE)\lib\"
  421.  
  422. LINK_BASE = ilink /nologo /noe /map:$(MODULESDIR)\$(@B).map /linenumbers $(LIBDIRS)
  423.  
  424. !ifdef XWP_DEBUG
  425. LINK =  $(LINK_BASE) /debug
  426. LINK_ALWAYSPACK = $(LINK_BASE) /exepack:2
  427. !else
  428. LINK =  $(LINK_BASE) /optfunc /exepack:2
  429. LINK_ALWAYSPACK = $(LINK) /optfunc
  430. #/packcode /packdata
  431. # /optfunc
  432. !endif
  433.  
  434. # Some LINK386 cmd line options
  435. # (Visual Age ILINK understands these too if /nofree is specified):
  436. # /align:  executable pages align factor (in bytes)
  437. # /noe:    no extended dictionary. Required for replacing _DLL_InitTerm.
  438. #          Can slightly increase executable's size.
  439. # /noi:    no ignore case (necc. for C)
  440. # /map:    list public symbols (create MAP file); we always need this,
  441. #          because we produce a .SYM file later.
  442. # /linenumbers: include linenumbers in MAP file
  443. # /nod:    no default library search (explicitly specify libs)
  444. # /nol:    no logo (link386 startup)
  445. # /packcode: group neighboring code segments (enabled per default)
  446. # /packdata: group neighboring data segments (disabled per default)
  447. # /debug:  include debug code
  448. # /optfunc: optimize code arrangement (takes some extra time)
  449. # /exepack:2 use Warp 3 executable compression
  450.  
  451.  
  452. # RESOURCE COMPILER
  453. # -----------------
  454.  
  455. RCDEFS =
  456. !ifdef XWPLITE
  457. RCDEFS = -D__XWPLITE__
  458. !endif
  459.  
  460. RC      = rc -p -x2 -n -i $(TKBASE)\h -i $(PROJECT_BASE_DIR)\include $(RCDEFS)
  461. # -x2
  462. # RC options:
  463. # -p       pack (64K boundaries)
  464. # -x2      Warp 3 compression
  465. # -n       no logo
  466.  
  467.  
  468.  
  469.  
  470.