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

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