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

  1. #/*+=========================================================================
  2. #  File:       MAKEFILE
  3. #
  4. #  Summary:    Makefile for building the LOCSERVE.EXE binary.  LOCSERVE
  5. #              is a local COM server that offers the Car, UtilityCar,
  6. #              and CruiseCar components.  As a local server LOCSERVE
  7. #              makes used of the custom car-related interfaces (ICar,
  8. #              IUtility, and ICruise) that are marshaled by the
  9. #              MARSHAL.DLL server.  This Makefile thus depends on the
  10. #              prior build (and the resultant registration) of the
  11. #              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 LOCSERVE's
  17. #              contents and offerings see the tutorial LOCSERVE.HTM
  18. #              file.  For more specific technical details see the comments
  19. #              dispersed throughout the LOCSERVE source code.
  20. #
  21. #              See also LOCCLIEN.HTM (in the main tutorial directory) for
  22. #              more details on the LOCCLIEN client and how it works with
  23. #              LOCSERVE.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:     LOCSERVE.EXE
  33. #
  34. #  Origin:     11-14-95: atrent - Editor-inheritance from DLLCLIEN 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=locserve
  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)
  116. CDBG=$(cdebug) -DUNICODE -D_UNICODE
  117. RCFLAGS = -DWIN32 -DRC_INCLUDE -DUNICODE
  118. !ELSE
  119. LINKFLAGS = $(ldebug)
  120. CDBG=$(cdebug)
  121. RCFLAGS = -DWIN32 -DRC_INCLUDE
  122. !ENDIF
  123.  
  124. # If NODEBUG is not defined then define DEBUG during Compiles.
  125. # The default is to compile with debug symbols in the binaries.
  126. !IFNDEF NODEBUG
  127. CDBG = $(CDBG) -DDEBUG
  128. RCFLAGS = $(RCFLAGS) -DDEBUG
  129. !ENDIF
  130.  
  131. # APPLIBS are libraries used by this application that are outside
  132. # of its indigenous file set and are needed during the final link.
  133. APPLIBS = apputil.lib urlmon.lib
  134.  
  135. # PGMOBJS is a macro that defines the object files for this application.
  136. PGMOBJS = $(TDIR)\$(PGM).obj $(TDIR)\server.obj $(TDIR)\factory.obj \
  137.   $(TDIR)\car.obj $(TDIR)\utilcar.obj $(TDIR)\crucar.obj
  138.  
  139. # The final target.
  140. all: tempdir output
  141.  
  142. # Make the temporary work sub-directory.
  143. tempdir:
  144.   -mkdir $(TDIR)
  145.  
  146. # The actual output products.
  147. output: $(PGM).exe
  148.   if exist $(PGM).EXE if exist $(REGEXE) $(REGEXE) /e $(PGM).EXE
  149.  
  150. # Compilation/Dependency rules for the main source files.
  151. $(TDIR)\$(PGM).obj: $(PGM).cpp $(PGM).h
  152.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ $(PGM).cpp
  153.  
  154. $(TDIR)\server.obj: server.cpp server.h $(PGM).h
  155.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ server.cpp
  156.  
  157. $(TDIR)\factory.obj: factory.cpp factory.h server.h $(PGM).h
  158.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ factory.cpp
  159.  
  160. $(TDIR)\car.obj: car.cpp car.h server.h $(PGM).h
  161.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ car.cpp
  162.  
  163. $(TDIR)\utilcar.obj: utilcar.cpp utilcar.h server.h $(PGM).h
  164.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ utilcar.cpp
  165.  
  166. $(TDIR)\crucar.obj: crucar.cpp crucar.h server.h $(PGM).h
  167.   $(cc) $(cvars) $(cflags) $(CDBG) -Fo$@ crucar.cpp
  168.  
  169. # Compile the resources.
  170. $(TDIR)\$(PGM).res: $(PGM).rc $(PGM).ico $(PGM).h
  171.   rc $(RCFLAGS) -r -fo$@ $(PGM).rc
  172.  
  173. # Link the object and resource binaries into the final target binary.
  174. $(PGM).exe: $(PGMOBJS) $(TDIR)\$(PGM).res
  175.   $(LINK) @<<
  176.     $(LINKFLAGS)
  177.     -out:$@
  178.     -map:$(TDIR)\$*.map
  179.     $(PGMOBJS)
  180.     $(TDIR)\$*.res
  181.     $(olelibs) $(APPLIBS)
  182. <<
  183.  
  184. # Target to register the server
  185. register:
  186.   if exist $(PGM).EXE if exist $(REGEXE) $(REGEXE) /e $(PGM).EXE
  187.  
  188. # Target to unregister the server
  189. unregister:
  190.   if exist $(PGM).EXE if exist $(REGEXE) $(REGEXE) /e /u $(PGM).EXE
  191.  
  192. # Target to clean up temporary binaries.
  193. clean:
  194.   -del $(PGM).pdb
  195.   -deltree /y $(TDIR)
  196.   -rmdir /s /q $(TDIR)
  197.  
  198. # Target to clean up all generated files.
  199. cleanall:
  200.   if exist $(PGM).EXE if exist $(REGEXE) $(REGEXE) /e /u $(PGM).EXE
  201.   -del *.lib
  202.   -del *.exp
  203.   -del *.obj
  204.   -del *.res
  205.   -del *.map
  206.   -del *.pdb
  207.   -del *.vcp
  208.   -del *.aps
  209.   -del *.pch
  210.   -del *.sbr
  211.   -del *.bsc
  212.   -del *.mdp
  213.   -del *.ncb
  214.   -del *.mak
  215.   -del *.exe
  216.   -del *.dll
  217.   -del resource.h
  218.   -deltree /y windebug
  219.   -rmdir /s /q windebug
  220.   -deltree /y winrel
  221.   -rmdir /s /q winrel
  222.   -deltree /y $(TDIR)
  223.   -rmdir /s /q $(TDIR)
  224.