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

  1. #===================================================================
  2. #
  3. #   Image Make file - Porting Stage 3 : Pure 32 bit Application
  4. #           and 16-bit application
  5. #   Copyright 1991 IBM Corporation
  6. #
  7. #  The IMAGES1.MAK and .DEF files are provided for comparison purposes.
  8. #  Together with the source files, they are not
  9. #  sufficient to build a 16-bit executable.  They have a dependency on an
  10. #  OS/2 1.3 toolkit being available locally, since they need 16-bit
  11. #  compilers/linkers.  The sample source files contain conditional
  12. #  compilation statements for PORT_16 and PORT_32,
  13. #  which show some of the changes needed in making the port.
  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 the
  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. CC32 = icc /c /Gd- /Se /Re /ss /Ms /Gm+
  42. CCS1 = cl
  43. CFLAGSS1 = -u -c -G2s -Oi -W3 -Zpei -AL -DLINT_ARGS -NT CODE16 -ND DATA16 -DPORT_S116 -DHELP_MANAGER_ENABLED
  44. CFLAGS32 = -DLINT_ARGS -DHELP_MANAGER_ENABLED -DPORT_32
  45. CINC32 =
  46. CINCS1 =
  47. LINK32 = link386
  48. LIBS32 = os2386 libc
  49. LFLAGS = /MAP/CO/NOD
  50. RC = rc
  51. HEADERS = img_main.h img_xtrn.h
  52.  
  53.  
  54. #-------------------------------------------------------------------
  55. #   This section is used to set which options macros are to be used
  56. #   in the build.  By changing the macro names on the right, we can
  57. #   change which environment the application will be built for.  This
  58. #   application currently uses the flags for the 32-bit memory model.
  59. #-------------------------------------------------------------------
  60. LINK = $(LINK32)
  61. CFLAGS = $(CFLAGS32)
  62. LIBS = $(LIBS32)
  63. CINC = $(CINC32)
  64.  
  65.  
  66. #===================================================================
  67. #
  68. # Default inference rules
  69. #
  70. #   This section lists the command and flags to build each type of
  71. #   of source file listed.
  72. #
  73. #===================================================================
  74. .c.obj:
  75.     $(CC32) $(CFLAGS) $(CINC) $*.c
  76.  
  77. .rc.res:
  78.     $(RC) -r $*.rc
  79.  
  80. #-------------------------------------------------------------------
  81. #   A list of all of the object files
  82. #-------------------------------------------------------------------
  83. ALL_OBJ1 = img_utS1.obj img_daS1.obj img_inS1.obj img_pnS1.obj img_viS1.obj
  84. ALL_OBJ2 = img_dlS1.obj img_heS1.obj img_siS1.obj img_fiS1.obj img_meS1.obj img_mas1.obj
  85.  
  86. #-------------------------------------------------------------------
  87. #   A list of all of the Help text files
  88. #-------------------------------------------------------------------
  89. ALL_IPF = img_main.ipf img_file.ipf img_view.ipf img_help.ipf img_dlg.ipf
  90.  
  91. #-------------------------------------------------------------------
  92. #   This section lists all files to be built by the make.  This make
  93. #   file builds the executable as well as its associated help file.
  94. #-------------------------------------------------------------------
  95. all: imageS1.exe image.hlp
  96.  
  97.  
  98. #-------------------------------------------------------------------
  99. #   This section creates the command file used by the linker.  This
  100. #   command file is recreated automatically every time you change
  101. #   the object file list, linker flags, or library list.
  102. #-------------------------------------------------------------------
  103. imageS1.lnk: imageS1.mak
  104.     echo $(ALL_OBJ1) +           > imageS1.lnk
  105.     echo $(ALL_OBJ2)            >> imageS1.lnk
  106.     echo imageS1.exe            >> imageS1.lnk
  107.     echo imageS1.map $(LFLAGS)  >> imageS1.lnk
  108.     echo $(LIBS)                >> imageS1.lnk
  109.     echo imageS1.def            >> imageS1.lnk
  110.  
  111.  
  112.  
  113. #===================================================================
  114. #
  115. # Dependencies
  116. #
  117. #   This section lists all object files needed to be built for the
  118. #   application, along with the files it is dependent upon (e.g. its
  119. #   source and any header files).
  120. #
  121. #===================================================================
  122. img_maS1.res: img_main.rc img_main.h img_dlg.h image.dlg\
  123.               img_help.rc img_help.h
  124.     $(RC) -r img_main.rc img_maS1.res
  125.  
  126. img_maS1.obj: img_main.c $(HEADERS)
  127.     $(CC32) $(CFLAGS) $(CINC) -Foimg_maS1.obj img_main.c
  128.  
  129. img_meS1.obj: img_menu.c $(HEADERS)
  130.     $(CC32) $(CFLAGS) $(CINC) -Foimg_meS1.obj img_menu.c
  131.  
  132. img_siS1.obj: img_size.c $(HEADERS)
  133.     $(CC32) $(CFLAGS) $(CINC) -Foimg_siS1.obj img_size.c
  134.  
  135. img_fiS1.obj: img_file.c $(HEADERS)
  136.     $(CC32) $(CFLAGS) $(CINC) -Foimg_fiS1.obj img_file.c
  137.  
  138. img_viS1.obj: img_view.c $(HEADERS)
  139.     $(CC32) $(CFLAGS) $(CINC) -Foimg_viS1.obj img_view.c
  140.  
  141. img_daS1.obj: img_data.c $(HEADERS)
  142.     $(CC32) $(CFLAGS) $(CINC) -Foimg_daS1.obj img_data.c
  143.  
  144. img_inS1.obj: img_init.c $(HEADERS)
  145.     $(CC32) $(CFLAGS) $(CINC) -Foimg_inS1.obj img_init.c
  146.  
  147. img_pnS1.obj: img_pnt.c $(HEADERS)
  148.     $(CC32) $(CFLAGS) $(CINC) -Foimg_pnS1.obj img_pnt.c
  149.  
  150. img_dlS1.obj: img_dlg.c $(HEADERS)
  151.     $(CC32) $(CFLAGS) $(CINC) -Foimg_dlS1.obj img_dlg.c
  152.  
  153. img_heS1.obj: img_help.c $(HEADERS) img_help.h
  154.     $(CC32) $(CFLAGS) $(CINC) -Foimg_heS1.obj img_help.c
  155.  
  156. img_utS1.obj: img_util.c $(HEADERS)
  157.     $(CCS1) $(CFLAGSS1) $(CINC) -Fa -Foimg_utS1.obj img_util.c
  158. #-------------------------------------------------------------------
  159. #   This section creates the help manager file.  The IPF compiler
  160. #   creates a file called main.hlp which is renamed to image.hlp.
  161. #-------------------------------------------------------------------
  162. image.hlp: $(ALL_IPF)
  163.      ipfc img_main.ipf /W3
  164.      if exist image.hlp del image.hlp
  165.      rename img_main.hlp image.hlp
  166.  
  167.  
  168. #-------------------------------------------------------------------
  169. #   This section links the object modules into the finished program
  170. #   using the linker command file created earlier.  At the end, the
  171. #   resource file is bound to the application.
  172. #-------------------------------------------------------------------
  173. imageS1.exe: $(ALL_OBJ1) $(ALL_OBJ2) imageS1.def imageS1.lnk img_maS1.res
  174.     $(LINK) @imageS1.lnk
  175.     $(RC) img_maS1.res imageS1.exe
  176.