home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / SAMPLES / PM / PORTING / IMAGE32.MAK < prev    next >
Makefile  |  1995-08-24  |  7KB  |  175 lines

  1. #===================================================================
  2. #
  3. #   Image Make file - Porting Stage 3 : Pure 32 bit Application
  4. #
  5. #  Copyright (C) 1991, 1994 IBM Corporation
  6. #
  7. #      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is
  8. #      sample code created by IBM Corporation. This sample code is not
  9. #      part of any standard or IBM product and is provided to you solely
  10. #      for  the purpose of assisting you in the development of your
  11. #      applications.  The code is provided "AS IS", without
  12. #      warranty of any kind.  IBM shall not be liable for any damages
  13. #      arising out of your use of the sample code, even if they have been
  14. #      advised of the possibility of such damages.
  15. #
  16. #===================================================================
  17.  
  18. #-------------------------------------------------------------------
  19. #   .SUFFIXES line helps NMAKE recognize other file suffixes besides
  20. #   .c, .exe, etc.
  21. #-------------------------------------------------------------------
  22. .SUFFIXES: .res .rc .hlp .ipf
  23.  
  24. #===================================================================
  25. #
  26. # Macro definitions
  27. #
  28. #   These macro definitions set are used to set up the options needed
  29. #   to build the application.  Such options include the command line
  30. #   options for the compiler and the libraries needed for the linker.
  31. #   The flags are created as macros so that they can be easily modified
  32. #   so they need to be changed.
  33. #
  34. #   The macros also allow you to have a different set of options
  35. #   for each environment your application is built for.  The macros
  36. #   below include the flags for compiling the application in the
  37. #   32=bit and 16=bit memory models.  You can also add flags for a
  38. #   a retail version of the product, a version which does not contain
  39. #   any codeview symbols and has the maximum optimization.
  40. #
  41. #===================================================================
  42. include ..\..\ibmsamp.inc
  43. CFLAGS32 = -DLINT_ARGS -DHELP_MANAGER_ENABLED -DPORT_32
  44. CINC32 =
  45. LINK32 = link386
  46. LFLAGS = /MAP/CO/NOD
  47. RC = rc
  48. HEADERS = img_main.h img_xtrn.h
  49.  
  50.  
  51. #-------------------------------------------------------------------
  52. #   This section is used to set which options macros are to be used
  53. #   in the build.  By changing the macro names on the right, we can
  54. #   change which environment the application will be built for.  This
  55. #   application currently uses the flags for the 32-bit memory model.
  56. #-------------------------------------------------------------------
  57. LINK = $(LINK32)
  58. CFLAGS = $(CFLAGS32)
  59. CINC = $(CINC32)
  60.  
  61. #===================================================================
  62. #
  63. # Default inference rules
  64. #
  65. #   This section lists the command and flags to build each type of
  66. #   of source file listed.
  67. #
  68. #===================================================================
  69. .c.obj:
  70.     $(CC) $(CFLAGS) $(CINC) $*.c
  71.  
  72. .rc.res:
  73.     $(RC) -r $*.rc
  74.  
  75. #-------------------------------------------------------------------
  76. #   A list of all of the object files
  77. #-------------------------------------------------------------------
  78. ALL_OBJ1 = img_ma32.obj img_da32.obj img_in32.obj img_pn32.obj img_vi32.obj
  79. ALL_OBJ2 = img_dl32.obj img_he32.obj img_si32.obj img_fi32.obj img_me32.obj img_ut32.obj
  80.  
  81. #-------------------------------------------------------------------
  82. #   A list of all of the Help text files
  83. #-------------------------------------------------------------------
  84. ALL_IPF = img_main.ipf img_file.ipf img_view.ipf img_help.ipf
  85.  
  86. #-------------------------------------------------------------------
  87. #   This section lists all files to be build my the make.  This make
  88. #   file build the executible as well as its associated help file.
  89. #-------------------------------------------------------------------
  90. all: image32.exe image.hlp
  91.  
  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. image32.lnk: image32.mak
  100.     echo $(ALL_OBJ1) +           > image32.lnk
  101.     echo $(ALL_OBJ2)            >> image32.lnk
  102.     echo image32.exe            >> image32.lnk
  103.     echo image32.map $(LFLAGS)  >> image32.lnk
  104.     echo $(LIBS)                >> image32.lnk
  105.     echo image32.def            >> image32.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. img_ma32.res: img_main.rc img_main.h img_dlg.h image.dlg\
  119.               img_help.rc img_help.h
  120.     copy ..\..\prodinfo.bmp
  121.     $(RC) -r img_main.rc img_ma32.res
  122.     del prodinfo.bmp
  123.  
  124. img_ma32.obj: img_main.c $(HEADERS)
  125.     $(CC) $(CFLAGS) $(CINC) -Foimg_ma32.obj img_main.c
  126.  
  127. img_me32.obj: img_menu.c $(HEADERS)
  128.     $(CC) $(CFLAGS) $(CINC) -Foimg_me32.obj img_menu.c
  129.  
  130. img_si32.obj: img_size.c $(HEADERS)
  131.     $(CC) $(CFLAGS) $(CINC) -Foimg_si32.obj img_size.c
  132.  
  133. img_fi32.obj: img_file.c $(HEADERS)
  134.     $(CC) $(CFLAGS) $(CINC) -Foimg_fi32.obj img_file.c
  135.  
  136. img_vi32.obj: img_view.c $(HEADERS)
  137.     $(CC) $(CFLAGS) $(CINC) -Foimg_vi32.obj img_view.c
  138.  
  139. img_da32.obj: img_data.c $(HEADERS)
  140.     $(CC) $(CFLAGS) $(CINC) -Foimg_da32.obj img_data.c
  141.  
  142. img_in32.obj: img_init.c $(HEADERS)
  143.     $(CC) $(CFLAGS) $(CINC) -Foimg_in32.obj img_init.c
  144.  
  145. img_pn32.obj: img_pnt.c $(HEADERS)
  146.     $(CC) $(CFLAGS) $(CINC) -Foimg_pn32.obj img_pnt.c
  147.  
  148. img_dl32.obj: img_dlg.c $(HEADERS)
  149.     $(CC) $(CFLAGS) $(CINC) -Foimg_dl32.obj img_dlg.c
  150.  
  151. img_he32.obj: img_help.c $(HEADERS) img_help.h
  152.     $(CC) $(CFLAGS) $(CINC) -Foimg_he32.obj img_help.c
  153.  
  154. img_ut32.obj: img_util.c $(HEADERS)
  155.     $(CC) $(CFLAGS) $(CINC) -Foimg_ut32.obj img_util.c
  156.  
  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. image32.exe: $(ALL_OBJ1) $(ALL_OBJ2) image32.def image32.lnk img_ma32.res
  173.     $(LINK) @image32.lnk
  174.     $(RC) -p -x img_ma32.res image32.exe
  175.