home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pendem.zip / MAKEFILE < prev    next >
Text File  |  1994-07-19  |  7KB  |  215 lines

  1. #******************************************************************************
  2. #
  3. #       IBM Confidential
  4. #
  5. #       Copyright (c) IBM Corporation 1992
  6. #
  7. #       All Rights Reserved
  8. #
  9. #******************************************************************************
  10. #
  11. # The purpose of this template is to outline all the areas and items
  12. # that need to be covered. The following are some of those items
  13. #
  14. #     Handle Non Specific Machine Layouts - This will make the makefile
  15. #     -----------------------------------   more generic and portable
  16. #                                           regardless of the development
  17. #                                           tree. Macros should have
  18. #                                           relative paths to information
  19. #                                           in order for the makefiles to be
  20. #                                           more portable.
  21. #
  22. #
  23. #     National Language Support          -  The makefile will have to
  24. #     -------------------------             support all national language
  25. #                                           versions.  This applies to all
  26. #                                           modules that will contain trans-
  27. #                                           lations even if that translation
  28. #                                           is not the result of specific MRI
  29. #                                           which is part of the component.
  30. #
  31. #     Environment Setup                   - The makefile will setup the
  32. #     -----------------                     environment (ie. paths to tools,
  33. #                                           etc). This will insure that
  34. #                                           people involved can use the
  35. #                                           makefile without worrying
  36. #                                           about their local environment.
  37. #
  38. #     Use of Inline Response Files        - The makefile will dynamically
  39. #     ----------------------------          generate linker response files,
  40. #                                           def files etc. to support NLS,
  41. #                                           MMIO and other build variations.
  42. #
  43. # The following is a list of the order in which the makefile should be written.
  44. #
  45. #     Dot Directives - ie.
  46. #        .SUFFIXES:
  47. #        .SILENT:
  48. #        .IGNORE:
  49. #        .PRECIOUS:
  50. #
  51. #     Environment Setup
  52. #        Conditional setup and user defined macros
  53. #        Compiler Location w/ includes, libs and tools etc.
  54. #        Compiler/tools Macros
  55. #        Compiler/tools Options
  56. #        Additional user defined macros
  57. #
  58. #      Rules for Compiling and assembling
  59. #        .c.obj
  60. #        .asm.obj
  61. #        .exe.com
  62. #
  63. #      Common target information "common.mak" for dependency generation and
  64. #      nls processing
  65. #
  66. #      User Target Information
  67. #         all
  68. #         debug
  69. #
  70. #      Specific Description Blocks
  71. #
  72. #      Description block for dynamic dependencies generation "depend.mak"
  73. #
  74. #      Indirect Dependencies for SOURCE "depend.mak"
  75. #         .obj:   .c .h .inc
  76. #
  77. # It is very important to have the makefile in the above order to make both
  78. # the developers job and the build departments job that much easier.
  79. #
  80. # ******  NOTE  ******
  81. #
  82. #   Please make sure that the MAKEFILE is documented. There have been many
  83. #   occasions that someone other then people working on your component have
  84. #   had a chance to inquire about what the dependencies are and what files
  85. #   are created as a result.
  86. #
  87. #   The makefile should be a document in itself. It will discribe how to
  88. #   to create the component. It is VERY inportant that any special
  89. #   consideration be documented. The following is an example of a problem
  90. #   and its documentation.
  91. #
  92. #****************************************************************************
  93. #  Dot directive definition area (usually just suffixes)
  94. #****************************************************************************
  95.  
  96. .SUFFIXES:
  97. .SUFFIXES: .c .obj .dll .h .rc .res .exe .map .lib
  98.  
  99. #****************************************************************************
  100. #  Environment Setup for the component(s).
  101. #****************************************************************************
  102.  
  103. #
  104. # Conditional Setup Area and User Defined Macros
  105. #
  106.  
  107. !ifndef LANG
  108. LANG=us
  109. !endif
  110.  
  111. !ifndef MRI
  112. MRI=mri
  113. !endif
  114.  
  115. ####
  116. ####   Path definitions for lib,tools,etc.
  117. ####
  118.  
  119. IH      = x:\src\pen\h
  120. TLKH    = x:\src\pen\pentkt\h
  121. PENH    = .;$(IH);$(TLKH)
  122. TLKL    = x:\src\pen\pentkt\lib
  123. PENL    = .;$(ILIB);$(TLKL);x:\src\pen\lib
  124. TOOLS   = x:\tools
  125. CSET2H  = $(TOOLS)\cset2\include;$(TOOLS)\cset2\include\sys
  126. CSET2L  = $(TOOLS)\cset2\lib
  127. CSET2B  = $(TOOLS)\cset2\bin
  128. CSET2M  = $(TOOLS)\cset2\locale;$(TOOLS)\cset2\help
  129. OS2H    = $(TOOLS)\toolkt20\c\os2h
  130. OS2L    = $(TOOLS)\toolkt20\os2lib
  131. OS2B    = $(TOOLS)\toolkt20\os2bin
  132. MRIPATH = x:\$(MRI)\pen
  133.  
  134. !if [set INCLUDE=$(PENH);$(CSET2H);$(OS2H)]      ||  \
  135.     [set LIB=$(PENL);$(CSET2L);$(OS2L);]                             ||  \
  136.     [set PATH=$(CSET2B);$(OS2B);$(TOOLS);$(PATH)]                    ||  \
  137.     [set DPATH=$(CSET2M);$(DPATH)]
  138. !endif
  139. DEBUG=  /Ti+ /O-
  140.  
  141. CC =  icc /C+ /DOS2_2 /DINCL_32 /Fd+ /Gd-e+ /Smr+s+
  142.  
  143.  
  144. # going to link to these
  145. PBLIBS =  OS2386 penpm
  146.  
  147.  
  148.  
  149. PLAYB_LINKOPTS = /NOE /ALIGN:16 /EXEPACK /M /BASE:0x10000 /Line
  150.  
  151. RC  = rc -r
  152.  
  153.  
  154. .rc.res:
  155.     $(RC) $*.rc
  156.  
  157. .c.obj:
  158.     $(CC) $*.c
  159.  
  160.  
  161. #   include rules for NLS and incremental builds
  162.  
  163. #!include "$(IH)\common.mak"
  164.  
  165.  
  166. # everything to be built
  167. all : book.exe
  168.  
  169. # tells MASTER makefile what to clean
  170. clean:
  171.     -del *.dll
  172.     -del *.sym
  173.     -del *.obj
  174.     -del *.map
  175.     -del *.res
  176.  
  177. book.exe:  book.obj bookfl.obj bookrs.res book.def
  178.   link386 @<<
  179.    $(PLAYB_LINKOPTS) book.obj bookfl.obj,
  180.    book.exe,
  181.    book.map,
  182.    $(PBLIBS),
  183.    book.def
  184. <<
  185.             rc bookrs.res book.exe
  186.             mapsym -n book.map
  187.  
  188. bookrs.res: bookrs.rc bookrs.dlg book.ico
  189.   rc -r /DINCL_32 bookrs.rc
  190.  
  191. #****************************************************************************
  192. #  Dependency Checking
  193. #****************************************************************************
  194.  
  195. # if on BUILD machine
  196. !ifndef SARKA
  197. depend.mak: dephold
  198.    touch depchk
  199.    includes -e -l -I. -I$(IH) -I$(TLKH) -P$$(IH)=$(IH) -P$$(TLKH)=$(TLKH) *.c >$@
  200.    includes -e -l -sres -C=rc -C=dlg -I. -I$(IH)  -P$$(IH)=$(IH))  *.rc >>$@
  201.    -del depchk
  202. # if on SARKA's machine
  203. !else
  204. depend.mak: dephold
  205.    touch depchk
  206.    includes -e -l -I. -I$(IH) -I$(TLKH) -P$$(IH)=$(IH) -P$$(TLKH)=$(TLKH)  *.c >$@
  207.    includes -e -l -sres -C=rc -C=dlg -I. -I$(IH)  -P$$(IH)=$(IH))  *.rc >>$@
  208.    -del depchk
  209. !endif
  210.  
  211. dephold:
  212.    touch $@
  213.  
  214. !include depend.mak
  215.