home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gpiimage.zip / IMAGE16.MAK < prev    next >
Makefile  |  1998-04-20  |  7KB  |  176 lines

  1. #===================================================================
  2. #
  3. #    Make file for the 16-bit Image sample.
  4. #   Copyright 1991 IBM Corporation
  5. #
  6. #  The IMAGE16.MAK and .DEF files are provided for comparison purposes.
  7. #  Together with the source files, they are not
  8. #  sufficient to build a 16-bit executable.  They have a dependency on an
  9. #  OS/2 1.3 toolkit being available locally, since they need 16-bit
  10. #  compilers/linkers.  The sample source files contain conditional
  11. #  compilation statements for PORT_16 and PORT_32,
  12. #  which show some of the changes needed in making the port.
  13. #
  14. #===================================================================
  15.  
  16. #-------------------------------------------------------------------
  17. #   .SUFFIXES line helps NMAKE recognize other file suffixes besides
  18. #   .c, .exe, etc.
  19. #-------------------------------------------------------------------
  20. .SUFFIXES: .res .rc .hlp .ipf
  21.  
  22.  
  23. #===================================================================
  24. #
  25. # Macro definitions
  26. #
  27. #   These macro definitions set are used to set up the options needed
  28. #   to build the application.  Such options include the command line
  29. #   options for the compiler and the libraries needed for the linker.
  30. #   The flags are created as macros so that they can be easily modified
  31. #   so they need to be changed.
  32. #
  33. #   The macros also allow you to have a different set of options
  34. #   for each environment your application is built for.  The macros
  35. #   below include the flags for compiling the application in
  36. #   32-bit and 16-bit versions.  You can also add flags for a
  37. #   a retail version of the product, a version which does not contain
  38. #   any debugger symbols and has the maximum optimization.
  39. #
  40. #===================================================================
  41. CC = cl -c
  42. CFLAGS16 = -u -Gs -Od -W3 -Zpei -AL -DHELP_MANAGER_ENABLED -DPORT_16
  43. CINC16 =
  44. LINK16 = link
  45. LIBS16 = os2286 llibcep
  46. LFLAGS = /MAP/CO/NOD
  47. RC = rc
  48. HEADERS = img_main.h img_xtrn.h
  49.  
  50. #-------------------------------------------------------------------
  51. #   This section is used to set which options macros are to be used
  52. #   in the build.  By changing the macro names on the right, we can
  53. #   change which environment the application will be built for.  This
  54. #   make file has flags set for the 16-bit memory model.
  55. #-------------------------------------------------------------------
  56. LINK = $(LINK16)
  57. CFLAGS = $(CFLAGS16)
  58. LIBS = $(LIBS16)
  59. CINC = $(CINC16)
  60.  
  61.  
  62. #===================================================================
  63. #
  64. # Default inference rules
  65. #
  66. #   This section lists the command and flags to build each type of
  67. #   of source file listed.
  68. #
  69. #===================================================================
  70. .c.obj:
  71.     $(CC) $(CFLAGS) $(CINC) $*.c
  72.  
  73. .rc.res:
  74.     $(RC) -r $*.rc
  75.  
  76. #-------------------------------------------------------------------
  77. #   A list of all of the object files
  78. #-------------------------------------------------------------------
  79. ALL_OBJ1 = img_ma16.obj img_da16.obj img_in16.obj img_pn16.obj img_vi16.obj
  80. ALL_OBJ2 = img_dl16.obj img_he16.obj img_si16.obj img_fi16.obj img_me16.obj img_ut16.obj
  81.  
  82. #-------------------------------------------------------------------
  83. #   A list of all of the Help text files
  84. #-------------------------------------------------------------------
  85. ALL_IPF = img_main.ipf img_file.ipf img_view.ipf img_help.ipf img_dlg.ipf
  86.  
  87. #-------------------------------------------------------------------
  88. #   This section lists all files to be build my the make.  This make
  89. #   file build the executible as well as its associated help file.
  90. #-------------------------------------------------------------------
  91. all: image16.exe image.hlp
  92.  
  93.  
  94. #-------------------------------------------------------------------
  95. #   This section creates the command file used by the linker.  This
  96. #   command file is recreated automatically every time you change
  97. #   the object file list, linker flags, or library list.
  98. #-------------------------------------------------------------------
  99. image16.lnk: image16.mak
  100.     echo $(ALL_OBJ1) +             > image16.lnk
  101.     echo $(ALL_OBJ2)              >> image16.lnk
  102.     echo image16.exe              >> image16.lnk
  103.     echo image16.map $(LFLAGS)    >> image16.lnk
  104.     echo $(LIBS)                  >> image16.lnk
  105.     echo image16.def              >> image16.lnk
  106.  
  107.  
  108.  
  109. #===================================================================
  110. #
  111. # Dependencies
  112. #
  113. #   This section lists all object files needed to be built for the
  114. #   application, along with the files it is dependent upon (e.g. its
  115. #   source and any header files).
  116. #
  117. #===================================================================
  118.  
  119. img_ma16.res: img_main.rc img_main.h img_dlg.h image.dlg \
  120.               img_help.rc img_help.h
  121.     copy ..\prodinfo.bmp
  122.     $(RC) -r img_main.rc img_ma16.res
  123.     del prodinfo.bmp
  124.  
  125. img_ma16.obj: img_main.c $(HEADERS)
  126.     $(CC) $(CFLAGS) $(CINC) -Foimg_ma16.obj img_main.c
  127.  
  128. img_me16.obj: img_menu.c $(HEADERS)
  129.     $(CC) $(CFLAGS) $(CINC) -Foimg_me16.obj img_menu.c
  130.  
  131. img_si16.obj: img_size.c $(HEADERS)
  132.     $(CC) $(CFLAGS) $(CINC) -Foimg_si16.obj img_size.c
  133.  
  134. img_fi16.obj: img_file.c $(HEADERS)
  135.     $(CC) $(CFLAGS) $(CINC) -Foimg_fi16.obj img_file.c
  136.  
  137. img_vi16.obj: img_view.c $(HEADERS)
  138.     $(CC) $(CFLAGS) $(CINC) -Foimg_vi16.obj img_view.c
  139.  
  140. img_da16.obj: img_data.c $(HEADERS)
  141.     $(CC) $(CFLAGS) $(CINC) -Foimg_da16.obj img_data.c
  142.  
  143. img_dl16.obj: img_dlg.c $(HEADERS)
  144.     $(CC) $(CFLAGS) $(CINC) -Foimg_dl16.obj img_dlg.c
  145.  
  146. img_in16.obj: img_init.c $(HEADERS)
  147.     $(CC) $(CFLAGS) $(CINC) -Foimg_in16.obj img_init.c
  148.  
  149. img_pn16.obj: img_pnt.c $(HEADERS)
  150.     $(CC) $(CFLAGS) $(CINC) -Foimg_pn16.obj img_pnt.c
  151.  
  152. img_he16.obj: img_help.c $(HEADERS) img_help.h
  153.     $(CC) $(CFLAGS) $(CINC) -Foimg_he16.obj img_help.c
  154.  
  155. img_ut16.obj: img_util.c $(HEADERS)
  156.     $(CC) $(CFLAGS) $(CINC) -Fa -Oi -Foimg_ut16.obj img_util.c
  157. #-------------------------------------------------------------------
  158. #   This section creates the help manager file.  The IPF compiler
  159. #   creates a file called main.hlp which is renamed to image.hlp.
  160. #-------------------------------------------------------------------
  161. image.hlp: $(ALL_IPF)
  162.      ipfc img_main.ipf /W3
  163.      if exist image.hlp del image.hlp
  164.      rename img_main.hlp image.hlp
  165.  
  166.  
  167. #-------------------------------------------------------------------
  168. #   This section links the object modules into the finished program
  169. #   using the linker command file created earlier.  At the end, the
  170. #   resource file is bound to the application.
  171. #-------------------------------------------------------------------
  172. image16.exe: $(ALL_OBJ1) $(ALL_OBJ2) image16.def image16.lnk img_ma16.res
  173.     $(LINK) @image16.lnk
  174.     $(RC) img_ma16.res image16.exe
  175.     mapsym image16
  176.