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 / remclien / makefile next >
Makefile  |  1997-08-05  |  8KB  |  216 lines

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