home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / mapi / simple.frm / makefile < prev    next >
Makefile  |  1996-07-26  |  3KB  |  104 lines

  1. # Makefile to build the MAPI Sample Form
  2. #Copyright (c) 1986-1996, Microsoft Corporation.
  3.  
  4. #REM Key to CPU specific conditions, CPU == i386 || ALPHA || MIPS || PPC     1) cvtres
  5. #     cvtres -$(CPU) ...
  6. !IF "$(CPU)" == ""
  7. !IF "$(PROCESSOR_ARCHITECTURE)" == "MIPS" || "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" || "$(PROCESSOR_ARCHITECTURE)" == "PPC"
  8. CPU = $(PROCESSOR_ARCHITECTURE)
  9. !ELSE
  10. CPU = i386
  11. !ENDIF
  12. !ENDIF
  13.  
  14. !include <win32.mak>
  15.  
  16. !IFDEF MAPISAMP
  17. HOME   = $(MAPISAMP)\simple.frm^\
  18. COMMON = $(MAPISAMP)\common^\
  19. rcvars = $(rcvars) /I$(HOME)
  20. !ELSE
  21. HOME   = 
  22. COMMON = ..\common^\
  23. !ENDIF
  24.  
  25. !IFNDEF NODEBUG
  26. cflags = $(cflags) -DDEBUG
  27. !ENDIF
  28.  
  29. PROJ     = SMPFRM32
  30.  
  31. # Main target dependencies
  32.  
  33. all: $(PROJ).exe
  34.  
  35. # Extra libraries need, not defined in win32.mak
  36.  
  37. extralibs = mapi32.lib ole32.lib uuid.lib
  38.  
  39. # This sample requires the extra lib libcimt.lib when building with VC++ 4.2
  40. # Rather than specifying that explicitly (it is difficult to determine
  41. # compiler version number in a makefile), instead, link with the extra
  42. # library by turning off the /NODEFAULTLIB link switch that is normally
  43. # defined in win32.mak in the the lflags macro.  Below, we define our own
  44. # alternative to $(lflags)
  45.  
  46. deflflags  = /INCREMENTAL:NO /PDB:NONE /RELEASE /NOLOGO
  47.  
  48.  
  49.  
  50. # Object files we need to build
  51.  
  52. OBJS = formbase.obj formwnd.obj guid.obj iclassf.obj \
  53.     main.obj viewntfr.obj 
  54.  
  55. COMMON_OBJS = wrap3d.obj cindex.obj lasterr.obj
  56. !IFNDEF NODEBUG
  57. COMMON_OBJS = $(COMMON_OBJS) mapidbg.obj
  58. !ENDIF
  59.  
  60. # Build the object files
  61.  
  62. {$(HOME)}.c.obj:
  63.   $(cc) /I$(COMMON) $(cdebug) $(cflags)  $(cvarsmt) $**
  64.  
  65. {$(HOME)}.cpp.obj:
  66.   $(cc) /I$(COMMON) $(cdebug) $(cflags)  $(cvarsmt) $**
  67.  
  68. lasterr.obj: $(COMMON)lasterr.cpp
  69.   $(cc) /I$(COMMON) $(cdebug) $(cflags) $(cvarsmt) $**
  70.   
  71.  
  72. wrap3d.obj: $(COMMON)wrap3d.c
  73.   $(cc) /I$(COMMON) $(cdebug) $(cflags) $(cvarsmt) $**
  74.  
  75. mapidbg.obj: $(COMMON)mapidbg.c
  76.   $(cc) /I$(COMMON) $(cdebug) $(cflags) $(cvarsmt) $**
  77.  
  78. cindex.obj: $(COMMON)cindex.c
  79.   $(cc) /I$(COMMON) $(cdebug) $(cflags) $(cvarsmt) $**
  80.  
  81. # Build the resources
  82.  
  83. $(PROJ).res: $(HOME)SMPFRM.RC
  84.   $(rc) /I$(COMMON) $(rcflags) $(rcvars) /fo $(PROJ).res $(HOME)SMPFRM.RC
  85.  
  86. # Link it together to make the executable image
  87.  
  88. $(PROJ).exe: $(OBJS) $(COMMON_OBJS) $(PROJ).res
  89.   $(link) $(linkdebug) $(deflflags) \
  90.    -subsystem:windows,$(APPVER) $(OBJS) \
  91.   $(COMMON_OBJS) $(PROJ).res $(guilibsmt) $(extralibs) -out:$(PROJ).exe
  92. !IFDEF MAPISAMP
  93.   -copy $@ $(MAPISAMP)\bin\$(PLATFORM)
  94. !ENDIF
  95.  
  96. # Clean up the intermediate files
  97.  
  98. clean:
  99.   -del *.obj
  100.   -del *.res 
  101.   -del *.lib 
  102.   -del *.exe 
  103.   -del *.exp
  104.