home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / tools / xlvm / makefile < prev    next >
Makefile  |  2002-04-16  |  5KB  |  144 lines

  1. #
  2. # makefile:
  3. #       makefile for TOOLS\xlvm directory.
  4. #       For use with IBM NMAKE, which comes with the IBM compilers,
  5. #       the Developer's Toolkit, and the DDK.
  6. #
  7. #       All the makefiles have been restructured with V0.9.0.
  8. #
  9. #       Called from:    main makefile
  10. #
  11. #       Input:          files in this directory
  12. #
  13. #       Output:         xlvm.exe, copied to parent directory (TOOLS\).
  14. #
  15. #       Edit "setup.in" to set up the make process.
  16. #
  17.  
  18. # Say hello to yourself.
  19. !if [@echo +++++ Entering $(MAKEDIR)]
  20. !endif
  21.  
  22. # include setup (compiler options etc.)
  23. !include ..\..\setup.in
  24.  
  25. # FIXED MACROS
  26. # ------------
  27. #
  28. # You probably need not change the following.
  29. #
  30.  
  31. # Define the suffixes for files which NMAKE will work on.
  32. # .SUFFIXES is a reserved NMAKE keyword ("pseudotarget") for
  33. # defining file extensions that NMAKE will recognize.
  34. .SUFFIXES: .cpp .obj .h
  35.  
  36. # OUTPUTDIR specifies the directory where all the output .OBJ
  37. # files will be created in.
  38. OUTPUTDIR = $(XWP_OUTPUT_ROOT)\exe_mt
  39. MODULESDIR = $(XWP_OUTPUT_ROOT)\modules
  40.  
  41. !if [@md $(XWP_OUTPUT_ROOT) 2> NUL]
  42. !endif
  43. !if [@md $(OUTPUTDIR) 2> NUL]
  44. !endif
  45. !if [@md $(MODULESDIR) 2> NUL]
  46. !endif
  47.  
  48. APPNAME = xlvm
  49.  
  50. # The OBJS macro contains all the .OBJ files which need to be
  51. # created from the files in this directory.
  52. # These will be put into BIN\.
  53. OBJS = $(OUTPUTDIR)\$(APPNAME).obj $(OUTPUTDIR)\helpers.lib lvm.lib $(HELPERS_BASE)\src\helpers\pmprintf.lib
  54.  
  55. # The main target:
  56. # If we're called from the main makefile, MAINMAKERUNNING is defined,
  57. # and we'll set $(OBJS) as our targets (which will go on).
  58. # Otherwise, we call the main makefile, which will again call ourselves later.
  59. all: helpers \
  60.     $(XWPRUNNING)\bin\$(APPNAME).exe
  61.     @echo ----- Leaving $(MAKEDIR)
  62.  
  63. SUBMAKE_PASS_STRING = "PROJECT_BASE_DIR=$(PROJECT_BASE_DIR)" "PROJECT_INCLUDE=$(PROJECT_INCLUDE)"
  64.  
  65. helpers:
  66.     @cd $(HELPERS_BASE)\src\helpers
  67.     @nmake -nologo all "MAINMAKERUNNING=YES" $(SUBMAKE_PASS_STRING) \
  68. "HELPERS_OUTPUT_DIR=$(XWP_OUTPUT_ROOT)\exe_mt" "CC_HELPERS=$(CC_HELPERS_EXE_MT)"
  69.     @cd $(MAKEDIR)
  70.  
  71. # Now define inference rules for what to do with certain file
  72. # types, based on their file extension.
  73. # The syntax we need here is ".fromext.toext".
  74. # So whenever NMAKE encounters a .toext file, it
  75. # executes what we specify here.
  76. # The ugly {} brackets are some awkward syntax for specifying
  77. # files in other directories.
  78.  
  79. # Special macros used here: $(@B) is the current target w/out ext.
  80.  
  81. # -- compile C files to .OBJ files, using the CC macro above.
  82. #    The output will be placed in the directory specified by
  83. #    the OUTPUTDIR variable (set above).
  84.  
  85. .cpp.{$(OUTPUTDIR)}.obj:
  86.         @echo $(MAKEDIR)\makefile: Compiling $(@B).cpp
  87. !ifndef PRECH
  88. # precompiled headers disabled:
  89.         $(CC_EXE_MT) /w1 /Fo$(OUTPUTDIR)\$(@B).obj $(@B).cpp
  90. !else
  91.         $(CC_EXE_MT) /w1 /fi"$(PRECH)\$(@B).pch" /si"$(PRECH)\$(@B).pch" /Fo$(OUTPUTDIR)\$(@B).obj $(@B).cpp
  92. !endif
  93.  
  94. # main include path
  95. INC = ..\..\include
  96. # base include path
  97. BSINC = $(INC)\base
  98. # helpers include path
  99. HLPINC = $(HELPERS_BASE)\include\helpers
  100.  
  101. # Now define dependencies for all our .OBJ files by telling NMAKE
  102. # which .OBJ file depends on what. For each .OBJ we define what files
  103. # will enforce a recompilation when they've been changed.
  104. # This uses the inference rules defined above.
  105.  
  106. # Note that include\setup.h is specified with _all_ files, so
  107. # you can enforce a complete recompile of XWorkplace if you update
  108. # that file (just save it once).
  109.  
  110. $(OUTPUTDIR)\$(APPNAME).obj: \
  111.     $(INC)\setup.h $(INC)\bldlevel.h \
  112.     $(HELPERS_BASE)\include\expat\expat.h \
  113.     $(HLPINC)\cnrh.h $(HLPINC)\datetime.h $(HLPINC)\dosh.h $(HLPINC)\except.h $(HLPINC)\linklist.h \
  114.         $(HLPINC)\stringh.h $(HLPINC)\threads.h $(HLPINC)\tree.h $(HLPINC)\winh.h \
  115.         $(HLPINC)\xstring.h $(HLPINC)\xml.h \
  116.     $(INC)\shared\common.h \
  117.     $(APPNAME).h
  118.  
  119. # build targets
  120. $(APPNAME).def: ..\..\include\bldlevel.h makefile
  121.           $(RUN_BLDLEVEL) $*.def ..\..\include\bldlevel.h "XML tester"
  122.  
  123. $(OUTPUTDIR)\$(APPNAME).res: $(@B).rc *.ico
  124.           $(RC) -r $(@B).rc $(OUTPUTDIR)\$(@B).res
  125.  
  126. $(MODULESDIR)\$(APPNAME).exe: $(OBJS) $(@B).def $(OUTPUTDIR)\$(@B).res makefile
  127.           $(LINK) /out:$(MODULESDIR)\$(@B).exe $(OBJS) $(@B).def
  128.           $(RC) $(OUTPUTDIR)\$(@B).res $(MODULESDIR)\$(@B).exe
  129. !ifdef XWP_OUTPUT_ROOT_DRIVE
  130.         @$(XWP_OUTPUT_ROOT_DRIVE)
  131. !endif
  132.           cd $(MODULESDIR)
  133.           mapsym /n $(@B).map > NUL
  134.           cmd.exe /c copy $(@B).sym $(XWPRUNNING)\bin
  135. !ifdef CVS_WORK_ROOT_DRIVE
  136.         @$(CVS_WORK_ROOT_DRIVE)
  137. !endif
  138.           cd $(MAKEDIR)
  139.  
  140. # main target
  141. $(XWPRUNNING)\bin\$(APPNAME).exe: $(MODULESDIR)\$(@B).exe
  142.           cmd.exe /c copy $(MODULESDIR)\$(@B).exe $(XWPRUNNING)\bin
  143.  
  144.