home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 19.ddi / MFC / SAMPLES / SAMPLE_.MA_ / SAMPLE_.MA
Encoding:
Text File  |  1993-02-08  |  3.4 KB  |  133 lines

  1.  
  2. # This is a part of the Microsoft Foundation Classes C++ library.
  3. # Copyright (C) 1992 Microsoft Corporation
  4. # All rights reserved.
  5. #
  6. # This source code is only intended as a supplement to the
  7. # Microsoft Foundation Classes Reference and Microsoft
  8. # QuickHelp and/or WinHelp documentation provided with the library.
  9. # See these sources for detailed information regarding the
  10. # Microsoft Foundation Classes product.
  11.  
  12. # Common include for building MFC Sample programs
  13. #
  14. #  typical usage
  15. #       PROJ = foo
  16. #       OBJS = foo.obj bar.obj ...
  17. #       !INCLUDE ..\SAMPLE_.MAK
  18. #
  19. # NOTE: do not include 'stdafx.obj' in the OBJS list - the correctly
  20. #    built version will be included for you
  21. #
  22. # Options to NMAKE:
  23. #     "AFXDLL=1" => build a DLL client app (default static MFC library)
  24. #     "DEBUG=0" => use retail (default debug)
  25. #     "OPT" => use to set custom compile options
  26. #     "BROWSE=1" => build Visual C++ compatible browse file (.BSC file)
  27.  
  28. !ifndef PROJ
  29.     !ERROR You forgot to define 'PROJ' !!
  30. !endif
  31. !ifndef OBJS
  32.     !ERROR You forgot to define 'OBJS' !!
  33. !endif
  34.  
  35. !if "$(AFXDLL)"!="1"
  36. # static link library variant [medium model] - the default
  37. CPPMAIN_FLAGS=/AM /Zp /GA /G2
  38. STDAFX=stdafx
  39. AFXLIB=mafxcw
  40. LIBS=mlibcew
  41. !else
  42. # dynamic link library variant [large model]
  43. CPPMAIN_FLAGS=/AL /Zp /GA /GEf /GEs /Gs /G2 /Gy /D_AFXDLL
  44. STDAFX=stdafxe
  45. AFXLIB=mfc200
  46. LIBS=llibcew
  47. !endif #//AFXDLL
  48.  
  49. !ifndef VBX
  50. STACK=/STACK:10240
  51. !else
  52. STACK=/STACK:20480
  53. !endif
  54.  
  55. !if "$(DEBUG)"!="0"
  56. # debug variant - the default
  57. CPPMAIN_FLAGS=/D_DEBUG $(CPPMAIN_FLAGS) /Od /Z7
  58. LINKFLAGS=/NOD /ONERROR:NOEXE $(STACK) /CODEVIEW
  59. AFXLIB=$(AFXLIB)D
  60. STDAFX=$(STDAFX)d
  61. !else
  62. # retail variant
  63. CPPMAIN_FLAGS=$(CPPMAIN_FLAGS) /O1
  64. LINKFLAGS=/NOD /ONERROR:NOEXE $(STACK)
  65. !endif #//DEBUG
  66.  
  67. !if "$(OPT)"!=""
  68. CPPMAIN_FLAGS=$(CPPMAIN_FLAGS) $(OPT)
  69. !endif
  70.  
  71. LIBS=$(AFXLIB) $(LIBS) libw commdlg shell olecli olesvr $(EXTRA_LIBS)
  72. CPPFLAGS=$(CPPMAIN_FLAGS) /W4 /Yustdafx.h /Fp..\$(STDAFX).pch
  73.  
  74. !if "$(BROWSE)"=="1"
  75. CPPFLAGS=$(CPPFLAGS) /FR
  76. SBRS=$(OBJS:.obj=.sbr)
  77. all: $(PROJ).exe $(PROJ).bsc
  78. !endif
  79.  
  80. #############################################################################
  81.  
  82. $(PROJ).exe: ..\$(STDAFX).obj $(PROJ).res $(PROJ).def $(OBJS)
  83.     link $(LINKFLAGS) @<<
  84. $(OBJS) ..\$(STDAFX).obj,
  85. $(PROJ),,$(LIBS),$(PROJ).def;
  86. <<
  87.     rc /31 /k /t $(PROJ).res
  88.  
  89. $(OBJS): ..\$(STDAFX).pch
  90.  
  91. $(PROJ).res:  resource.h
  92.     rc /r /z $(RCFLAGS) $(PROJ).rc
  93.  
  94. $(PROJ).bsc: $(SBRS) ..\$(STDAFX).sbr
  95.     bscmake @<<
  96. /o$@ $(SBRS) ..\$(STDAFX).sbr
  97. <<
  98.  
  99. clean::
  100.     -erase $(PROJ).exe
  101.     -erase $(PROJ).res
  102.     -erase $(PROJ).bsc
  103.     -erase *.aps
  104.     -erase *.pdb
  105.     -erase *.pch
  106.     -erase *.map
  107.     -erase *.obj
  108.     -erase *.sbr
  109.  
  110. #############################################################################
  111. # Shared PCH and PCT files (shared by all samples)
  112.  
  113. ..\$(STDAFX).obj ..\$(STDAFX).pch ..\$(STDAFX).sbr:: ..\stdafx.h ..\stdafx.cpp
  114.     @echo.
  115.     @echo Building shared Pre-Compiled Header/Type files.
  116.     @echo.
  117. !if "$(BROWSE)"=="1"
  118.     $(CPP) @<<
  119. $(CPPMAIN_FLAGS) /W4 /Ycstdafx.h /FR..\$(STDAFX).sbr /Fp..\$(STDAFX).pch /Fo..\$(STDAFX).obj /c ..\stdafx.cpp
  120. <<
  121. !else
  122.     $(CPP) @<<
  123. $(CPPMAIN_FLAGS) /W4 /Ycstdafx.h /Fp..\$(STDAFX).pch /Fo..\$(STDAFX).obj /c ..\stdafx.cpp
  124. <<
  125. !endif
  126.  
  127. cleanall: clean
  128.     -erase ..\$(STDAFX).pch
  129.     -erase ..\$(STDAFX).obj
  130.     -erase ..\$(STDAFX).sbr
  131.  
  132. #############################################################################
  133.