home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / xwplascr.zip / XWPL0208.ZIP / tools / h2i / makefile < prev   
Makefile  |  2002-01-19  |  4KB  |  145 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. COPYTODIR = ..
  42.  
  43. !ifndef XWP_DEBUG
  44. COPYTODIR = $(HELPERS_BASE)
  45. !endif
  46.  
  47. !if [@md $(XWP_OUTPUT_ROOT) 2> NUL]
  48. !endif
  49. !if [@md $(OUTPUTDIR) 2> NUL]
  50. !endif
  51. !if [@md $(MODULESDIR) 2> NUL]
  52. !endif
  53.  
  54. APPNAME = h2i
  55.  
  56. # The OBJS macro contains all the .OBJ files which need to be
  57. # created from the files in this directory.
  58. # These will be put into BIN\.
  59. OBJS = $(OUTPUTDIR)\$(APPNAME).obj $(OUTPUTDIR)\helpers.lib
  60.  
  61. # The main target:
  62. # If we're called from the main makefile, MAINMAKERUNNING is defined,
  63. # and we'll set $(OBJS) as our targets (which will go on).
  64. # Otherwise, we call the main makefile, which will again call ourselves later.
  65. all: helpers \
  66.     $(MODULESDIR)\$(APPNAME).exe
  67.     @echo ----- Leaving $(MAKEDIR)
  68.  
  69. SUBMAKE_PASS_STRING = "PROJECT_BASE_DIR=$(PROJECT_BASE_DIR)" "PROJECT_INCLUDE=$(PROJECT_INCLUDE)"
  70.  
  71. helpers:
  72.     @cd $(HELPERS_BASE)\src\helpers
  73.     @nmake -nologo all "MAINMAKERUNNING=YES" $(SUBMAKE_PASS_STRING) \
  74. "HELPERS_OUTPUT_DIR=$(XWP_OUTPUT_ROOT)\exe_mt" "CC_HELPERS=$(CC_HELPERS_EXE_MT)"
  75.     @cd $(MAKEDIR)
  76.  
  77. # Now define inference rules for what to do with certain file
  78. # types, based on their file extension.
  79. # The syntax we need here is ".fromext.toext".
  80. # So whenever NMAKE encounters a .toext file, it
  81. # executes what we specify here.
  82. # The ugly {} brackets are some awkward syntax for specifying
  83. # files in other directories.
  84.  
  85. # Special macros used here: $(@B) is the current target w/out ext.
  86.  
  87. # -- compile C files to .OBJ files, using the CC macro above.
  88. #    The output will be placed in the directory specified by
  89. #    the OUTPUTDIR variable (set above).
  90.  
  91. .cpp.{$(OUTPUTDIR)}.obj:
  92.         @echo $(MAKEDIR)\makefile: Compiling $(@B).cpp
  93. !ifndef PRECH
  94. # precompiled headers disabled:
  95.         $(CC_EXE_MT) /w1 /Fo$(OUTPUTDIR)\$(@B).obj $(@B).cpp
  96. !else
  97.         $(CC_EXE_MT) /w1 /fi"$(PRECH)\$(@B).pch" /si"$(PRECH)\$(@B).pch" /Fo$(OUTPUTDIR)\$(@B).obj $(@B).cpp
  98. !endif
  99.  
  100. # main include path
  101. INC = ..\..\include
  102. # base include path
  103. BSINC = $(INC)\base
  104. # helpers include path
  105. HLPINC = $(HELPERS_BASE)\include\helpers
  106.  
  107. # Now define dependencies for all our .OBJ files by telling NMAKE
  108. # which .OBJ file depends on what. For each .OBJ we define what files
  109. # will enforce a recompilation when they've been changed.
  110. # This uses the inference rules defined above.
  111.  
  112. # Note that include\setup.h is specified with _all_ files, so
  113. # you can enforce a complete recompile of XWorkplace if you update
  114. # that file (just save it once).
  115.  
  116. $(OUTPUTDIR)\$(APPNAME).obj: \
  117.     $(INC)\setup.h $(INC)\bldlevel.h \
  118.     $(APPNAME).h
  119.  
  120. # build targets
  121. $(APPNAME).def: ..\..\include\bldlevel.h makefile
  122.           $(RUN_BLDLEVEL) $*.def ..\..\include\bldlevel.h "XML tester"
  123.  
  124. $(MODULESDIR)\$(APPNAME).exe: $(OBJS) $(@B).def makefile
  125.           $(LINK) /out:$(MODULESDIR)\$(@B).exe $(OBJS) $(@B).def
  126. !ifdef XWP_OUTPUT_ROOT_DRIVE
  127.         @$(XWP_OUTPUT_ROOT_DRIVE)
  128. !endif
  129.           cd $(MODULESDIR)
  130.           mapsym /n $(@B).map > NUL
  131. !ifdef COPYTODIR
  132.           cmd.exe /c copy $(@B).sym $(COPYTODIR)
  133.           cmd.exe /c copy $(@B).exe $(COPYTODIR)
  134. !endif
  135. !ifdef COMMONBINDIR
  136.           cmd.exe /c copy $(@B).sym $(COMMONBINDIR)
  137.           cmd.exe /c copy $(@B).exe $(COMMONBINDIR)
  138. !endif
  139. !ifdef CVS_WORK_ROOT_DRIVE
  140.         @$(CVS_WORK_ROOT_DRIVE)
  141. !endif
  142.           cd $(MAKEDIR)
  143.  
  144.  
  145.