home *** CD-ROM | disk | FTP | other *** search
/ PC Press 1997 July / Sezamfile97_2.iso / windows / program / activex / axtsamp.exe / TSBRANCH.EXE / APTSERVE / MAKEFILE < prev    next >
Text File  |  1996-12-29  |  8KB  |  226 lines

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