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

  1. #
  2. # makefile:
  3. #       makefile for TOOLS\xmlview 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:         xmlview.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. $(XWP_OUTPUT_ROOT) is set by
  38. # setup.in to point to \bin from the XWorkplace sources root,
  39. # but this can be modified by setting an external environment
  40. # variable. This approach has the advantage that
  41. # 1) all build files are in a common dir tree and the entire
  42. #    tree can be removed completely;
  43. # 2) the build tree can be on a different physical drive for
  44. #    speed.
  45. OUTPUTDIR = $(XWP_OUTPUT_ROOT)\exe_mt
  46. MODULESDIR = $(XWP_OUTPUT_ROOT)\modules
  47.  
  48. !if [@md $(XWP_OUTPUT_ROOT) 2> NUL]
  49. !endif
  50. !if [@md $(OUTPUTDIR) 2> NUL]
  51. !endif
  52. !if [@md $(MODULESDIR) 2> NUL]
  53. !endif
  54.  
  55. APPNAME = xmlview
  56.  
  57. # The OBJS macro contains all the .OBJ files which need to be
  58. # created from the files in this directory.
  59. # These will be put into BIN\.
  60. OBJS = $(OUTPUTDIR)\$(APPNAME).obj $(OUTPUTDIR)\helpers.lib $(HELPERS_BASE)\src\helpers\pmprintf.lib
  61.  
  62. # The main target:
  63. # If we're called from the main makefile, MAINMAKERUNNING is defined,
  64. # and we'll set $(OBJS) as our targets (which will go on).
  65. # Otherwise, we call the main makefile, which will again call ourselves later.
  66. all: helpers \
  67.     $(XWPRUNNING)\bin\$(APPNAME).exe
  68.     @echo ----- Leaving $(MAKEDIR)
  69.  
  70. SUBMAKE_PASS_STRING = "PROJECT_BASE_DIR=$(PROJECT_BASE_DIR)" "PROJECT_INCLUDE=$(PROJECT_INCLUDE)"
  71.  
  72. helpers:
  73.     @cd $(HELPERS_BASE)\src\helpers
  74.     @nmake -nologo all "MAINMAKERUNNING=YES" $(SUBMAKE_PASS_STRING) \
  75. "HELPERS_OUTPUT_DIR=$(XWP_OUTPUT_ROOT)\exe_mt" "CC_HELPERS=$(CC_HELPERS_EXE_MT)"
  76.     @cd $(MAKEDIR)
  77.  
  78. # Now define inference rules for what to do with certain file
  79. # types, based on their file extension.
  80. # The syntax we need here is ".fromext.toext".
  81. # So whenever NMAKE encounters a .toext file, it
  82. # executes what we specify here.
  83. # The ugly {} brackets are some awkward syntax for specifying
  84. # files in other directories.
  85.  
  86. # Special macros used here: $(@B) is the current target w/out ext.
  87.  
  88. # -- compile C files to .OBJ files, using the CC macro above.
  89. #    The output will be placed in the directory specified by
  90. #    the OUTPUTDIR variable (set above).
  91.  
  92. .cpp.{$(OUTPUTDIR)}.obj:
  93.         @echo $(MAKEDIR)\makefile: Compiling $(@B).cpp
  94. !ifndef PRECH
  95. # precompiled headers disabled:
  96.         $(CC_EXE_MT) /w1 /Fo$(OUTPUTDIR)\$(@B).obj $(@B).cpp
  97. !else
  98.         $(CC_EXE_MT) /w1 /fi"$(PRECH)\$(@B).pch" /si"$(PRECH)\$(@B).pch" /Fo$(OUTPUTDIR)\$(@B).obj $(@B).cpp
  99. !endif
  100.  
  101. # main include path
  102. INC = ..\..\include
  103. # base include path
  104. BSINC = $(INC)\base
  105. # helpers include path
  106. HLPINC = $(HELPERS_BASE)\include\helpers
  107.  
  108. # Now define dependencies for all our .OBJ files by telling NMAKE
  109. # which .OBJ file depends on what. For each .OBJ we define what files
  110. # will enforce a recompilation when they've been changed.
  111. # This uses the inference rules defined above.
  112.  
  113. # Note that include\setup.h is specified with _all_ files, so
  114. # you can enforce a complete recompile of XWorkplace if you update
  115. # that file (just save it once).
  116.  
  117. $(OUTPUTDIR)\$(APPNAME).obj: \
  118.     $(INC)\setup.h $(INC)\bldlevel.h \
  119.     $(HELPERS_BASE)\include\expat\expat.h \
  120.     $(HLPINC)\cnrh.h $(HLPINC)\datetime.h $(HLPINC)\dosh.h $(HLPINC)\except.h $(HLPINC)\linklist.h \
  121.         $(HLPINC)\stringh.h $(HLPINC)\threads.h $(HLPINC)\tree.h $(HLPINC)\winh.h \
  122.         $(HLPINC)\xstring.h $(HLPINC)\xml.h \
  123.     $(INC)\shared\common.h \
  124.     $(APPNAME).h
  125.  
  126. # build targets
  127. $(APPNAME).def: ..\..\include\bldlevel.h makefile
  128.           $(RUN_BLDLEVEL) $*.def ..\..\include\bldlevel.h "XML tester"
  129.  
  130. $(OUTPUTDIR)\$(APPNAME).res: $(@B).rc *.ico
  131.           $(RC) -r $(@B).rc $(OUTPUTDIR)\$(@B).res
  132.  
  133. $(MODULESDIR)\$(APPNAME).exe: $(OBJS) $(@B).def $(OUTPUTDIR)\$(@B).res makefile
  134.     $(LINK) /out:$(MODULESDIR)\$(@B).exe $(OBJS) $(@B).def
  135.     $(RC) $(OUTPUTDIR)\$(@B).res $(MODULESDIR)\$(@B).exe
  136. !ifdef XWP_OUTPUT_ROOT_DRIVE
  137.     @$(XWP_OUTPUT_ROOT_DRIVE)
  138. !endif
  139.     cd $(MODULESDIR)
  140.     mapsym /n $(@B).map > NUL
  141.     cmd.exe /c copy $(@B).sym $(XWPRUNNING)\bin
  142. !ifdef CVS_WORK_ROOT_DRIVE
  143.     @$(CVS_WORK_ROOT_DRIVE)
  144. !endif
  145.     cd $(MAKEDIR)
  146.  
  147. # main target
  148. $(XWPRUNNING)\bin\$(APPNAME).exe: $(MODULESDIR)\$(@B).exe
  149.           cmd.exe /c copy $(MODULESDIR)\$(@B).exe $(XWPRUNNING)\bin
  150.  
  151.