home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / tutsamp / licclien / makefile < prev    next >
Makefile  |  1997-08-05  |  7KB  |  211 lines

  1. #/*+=========================================================================
  2. #  File:       MAKEFILE
  3. #
  4. #  Summary:    Makefile for building the LICCLIEN.EXE binary.  LICCLIEN
  5. #              acts as a client of the LICSERVE DLL server to create and
  6. #              manipulate some COM Components: Car, UtilityCar,
  7. #              LicCruiseCar, and UtilityCruiseCar.  One of these components
  8. #              (LicCruiseCar) is licensed.  LICCLIEN specifically works
  9. #              with the LICSERVE.DLL produced in the LICSERVE lesson (in
  10. #              sibling directory LICSERVE). LICCLIEN relies on the LICSERVE
  11. #              server to get the LicCruiseCar licensed component.  It
  12. #              relies on the previously studied DLLSERVE server to get the
  13. #              Car and UtilityCar unlicensed components.  This Makefile
  14. #              therefore depends on a prior build (and the resultant
  15. #              registration) of both the LICSERVE.DLL and DLLSERVE.DLL
  16. #              servers.
  17. #
  18. #              This Makefile creates a subdirectory (TEMP) for the
  19. #              .OBJ and .RES files used during the build process.
  20. #
  21. #              For a comprehensive tutorial code tour of LICCLIEN's
  22. #              contents and offerings see the tutorial LICCLIEN.HTM
  23. #              file.  For more specific technical details see the comments
  24. #              dispersed throughout the LICCLIEN source code.
  25. #
  26. #              See also LICSERVE.HTM (in the main tutorial directory) for
  27. #              more details on the LICSERVE library and how it works with
  28. #              LICCLIEN.EXE itself.
  29. #
  30. #              See also DLLSERVE.HTM (in the main tutorial directory) for
  31. #              more details on the DLLSERVE library and how it works with
  32. #              LICCLIEN.EXE itself.
  33. #
  34. #              In general, to set up your system to build and test the
  35. #              Win32 code samples in this COM Tutorial series, see the
  36. #              global TUTORIAL.HTM file for details.  This MAKEFILE is
  37. #              Microsoft NMAKE compatible and the 'debug' build can be
  38. #              achieved by simply issuing the NMAKE command in a command
  39. #              prompt window.
  40. #
  41. #  Builds:     LICCLIEN.EXE
  42. #
  43. #  Origin:     10-11-95: atrent - Editor-inheritance from DLLCLIEN makefile.
  44. #
  45. #--Usage:-------------------------------------------------------------------
  46. #  NMAKE Options
  47. #
  48. #  Use the table below to determine the additional options for NMAKE to
  49. #  generate various application debugging, profiling and performance tuning
  50. #  information.
  51. #
  52. #  Application Information Type         Invoke NMAKE
  53. #  ----------------------------         ------------
  54. #  For No Debugging Info                nmake nodebug=1
  55. #  For Working Set Tuner Info           nmake tune=1
  56. #  For Call Attributed Profiling Info   nmake profile=1
  57. #
  58. #  Note: The three options above are mutually exclusive (you may use only
  59. #        one to compile/link the application).
  60. #
  61. #  Note: creating the environment variables NODEBUG, TUNE, and PROFILE
  62. #        is an alternate method to setting these options via the nmake
  63. #        command line.
  64. #
  65. #  Additional NMAKE Options             Invoke NMAKE
  66. #  ----------------------------         ------------
  67. #  For No ANSI NULL Compliance          nmake no_ansi=1
  68. #    (ANSI NULL is defined as PVOID 0)
  69. #  To compile for Unicode               nmake unicode=1
  70. #    (Default is ANSI)
  71. #  To clean up temporary binaries       nmake clean
  72. #  To clean up all generated files      nmake cleanall
  73. #
  74. #---------------------------------------------------------------------------
  75. #  This file is part of the Microsoft COM Tutorial Code Samples.
  76. #
  77. #  Copyright (C) Microsoft Corporation, 1997.  All rights reserved.
  78. #
  79. #  This source code is intended only as a supplement to Microsoft
  80. #  Development Tools and/or on-line documentation.  See these other
  81. #  materials for detailed information regarding Microsoft code samples.
  82. #
  83. #  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  84. #  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  85. #  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  86. #  PARTICULAR PURPOSE.
  87. #=========================================================================+*/
  88.  
  89. #  WIN32.MAK should be included at the front of every Win32 makefile.
  90. #
  91. #  Define APPVER = [ 3.50 | 3.51 | 4.0 ] prior to including win32.mak to get
  92. #  build time checking for version dependencies and to mark the executable
  93. #  with version information.
  94. #
  95. #  Define TARGETOS = [ WIN95 | WINNT | BOTH ] prior to including win32.mak
  96. #  to get some build time checking for platform dependencies.
  97. #
  98. APPVER=4.0
  99. TARGETOS=BOTH
  100. !include <win32.mak>
  101.  
  102. # Assign the main program name macro.
  103. PGM=licclien
  104.  
  105. # Use a temporary sub-directory to store intermediate
  106. # binary files like *.obj, *.res, *.map, etc.
  107. TDIR = TEMP
  108.  
  109. # The sibling ..\INC and ..\LIB directories are added to the front of
  110. # the INCLUDE and LIB macros to inform the compiler and linker of
  111. # these application-specific locations for include and lib files.
  112. INCLUDE=..\inc;$(INCLUDE)
  113. LIB=..\lib;$(LIB)
  114.  
  115. LINK = $(link)
  116.  
  117. # If UNICODE=1 is defined then define UNICODE during Compiles.
  118. # The default is to compile with ANSI for running under both
  119. # Win95 and WinNT.
  120. !IFDEF UNICODE
  121. LINKFLAGS = $(ldebug)
  122. CDBG=$(cdebug) -DUNICODE -D_UNICODE
  123. RCFLAGS = -DWIN32 -DRC_INCLUDE -DUNICODE
  124. !ELSE
  125. LINKFLAGS = $(ldebug)
  126. CDBG=$(cdebug)
  127. RCFLAGS = -DWIN32 -DRC_INCLUDE
  128. !ENDIF
  129.  
  130. # If NODEBUG is not defined then define DEBUG during Compiles.
  131. # The default is to compile with debug symbols in the binaries.
  132. !IFNDEF NODEBUG
  133. CDBG = $(CDBG) -DDEBUG
  134. RCFLAGS = $(RCFLAGS) -DDEBUG
  135. !ENDIF
  136.  
  137. # APPLIBS are libraries used by this application that are outside
  138. # of its indigenous file set and are needed during the final link.
  139. APPLIBS = apputil.lib shell32.lib
  140.  
  141. # PGMOBJS is a macro that defines the object files for this application.
  142. PGMOBJS = $(TDIR)\$(PGM).obj $(TDIR)\utcrucar.obj
  143.  
  144. # The final target.
  145. all: tempdir output
  146.  
  147. # Make the temporary work sub-directory.
  148. tempdir:
  149.   -mkdir $(TDIR)
  150.  
  151. # The actual output products.
  152. output: $(PGM).exe
  153.  
  154. # Compilation/Dependency rules for the main source files.
  155. $(TDIR)\$(PGM).obj: $(PGM).cpp $(PGM).h
  156.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ $(PGM).cpp
  157.  
  158. $(TDIR)\utcrucar.obj: utcrucar.cpp utcrucar.h
  159.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ utcrucar.cpp
  160.  
  161. # Compile the resources.
  162. $(TDIR)\$(PGM).res: $(PGM).rc $(PGM).ico $(PGM).h
  163.   rc $(RCFLAGS) -r -fo$@ $(PGM).rc
  164.  
  165. # Link the object and resource binaries into the final target binary.
  166. $(PGM).exe: $(PGMOBJS) $(TDIR)\$(PGM).res
  167.   $(LINK) @<<
  168.     $(LINKFLAGS)
  169.     -out:$@
  170.     -map:$(TDIR)\$*.map
  171.     $(PGMOBJS)
  172.     $(TDIR)\$*.res
  173.     $(olelibs) $(APPLIBS)
  174. <<
  175.  
  176. # Target to clean up temporary binaries.
  177. clean:
  178.   -del $(PGM).pdb
  179.   -deltree /y $(TDIR)
  180.   -rmdir /s /q $(TDIR)
  181.  
  182. # Target to clean up all generated files.
  183. cleanall:
  184.   -del *.aps
  185.   -del *.bsc
  186.   -del *.dll
  187.   -del *.dsp
  188.   -del *.dsw
  189.   -del *.exe
  190.   -del *.exp
  191.   -del *.lib
  192.   -del *.mak
  193.   -del *.map
  194.   -del *.mdp
  195.   -del *.ncb
  196.   -del *.obj
  197.   -del *.opt
  198.   -del *.pch
  199.   -del *.pdb
  200.   -del *.plg
  201.   -del *.res
  202.   -del *.sbr
  203.   -del *.vcp
  204.   -del resource.h
  205.   -deltree /y $(TDIR)
  206.   -rmdir /s /q $(TDIR)
  207.   -deltree /y debug
  208.   -rmdir /s /q debug
  209.   -deltree /y release
  210.   -rmdir /s /q release
  211.