home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / master.mak < prev    next >
Encoding:
Text File  |  2000-06-23  |  4.0 KB  |  167 lines

  1. #needed so we can say foo.dll: foo.cpp and it will just work
  2. .SUFFIXES: .tlb  .il .dll .cpp .cs .vb .rc
  3.  
  4. #define the names of the compilers we ship
  5. _BC=vbc.exe
  6. _CL=cl.exe
  7. _C1=C1.dll
  8. _CX=c1xx.dll
  9. _C2=c2.dll
  10. _CS=csc.exe
  11. _ASSEM=ilasm.exe
  12.  
  13. #define the names of some common tools
  14. _TLBIMP=tlbimp.exe
  15. _TLBEXP=tlbexp.exe
  16. _REGASM=regasm.exe
  17. _REGSVR=regsvr32.exe
  18. _RSC=rc.exe
  19. _AL=al.exe
  20.  
  21. #define our basic link line for managed code
  22. _LINK=link.exe /debug
  23.  
  24. #define our basic core lib
  25. _LIBS=kernel32.lib mscoree.lib
  26.  
  27. #this is used for compiling cool samples
  28. #reset this in individual sample makefile to your imports if required
  29. _IMPORTS=
  30.  
  31. #this is used for compiling cool samples, that use Resources
  32. #reset this in individual sample makefile to your resource imports if required
  33. _WIN32RES=
  34.  
  35. #This is used for compiling cool samples that use Assembly and key files
  36. #reset this in individual sample makefile to your resource imports if required
  37. _KEYFILE=
  38.  
  39. #this is used for compiling cool samples
  40. #set the default out directory to .
  41. _OUTDIR=.
  42.  
  43. #set some command C++ flags
  44. _CCFLAGS=/com+ 
  45. _CFLAGS=$(_CCFLAGS) /c
  46.  
  47. #set debug as the default for c++
  48. _CDFLAGS=$(_CFLAGS) /Zi 
  49.  
  50. #set some command link flags
  51. _LFLAGS=
  52. _LDFLAGS=-dll
  53.  
  54. #set some common cool flags, default is debug
  55. _CS_DLL_FLAGS=/t:library /debug+
  56. _CS_EXE_FLAGS=/debug+
  57.  
  58. #set some common vb flags
  59. _VB_DLL_FLAGS=/t:library
  60. _VB_EXE_FLAGS=/t:exe
  61.  
  62. #default compile and link for c++ files building a dll
  63. #note: name.cpp and name.dll must match
  64. .cpp.dll:
  65.     $(_CL) $(_CDFLAGS) $*.cpp
  66.     $(_LINK) $(_LDFLAGS) $(_LIBS) /out:$(_OUTDIR)\$@ $*.obj
  67.  
  68. #default compile and link for c++ files building a exe
  69. #note: name.cpp and name.dll must match
  70. .cpp.exe:
  71.     $(_CL) $(_CDFLAGS) $*.cpp
  72.     $(_LINK) $(_LFLAGS) $(_LIBS) /out:$(_OUTDIR)\$@ $*.obj
  73.  
  74. #default compile and link for c++ files building an obj
  75. #note: name.cpp and name.obj must match
  76. .cpp.obj:    
  77.     $(_CL) $(_CDFLAGS) $*.cpp
  78.  
  79. #default compile and link for c++ files building an exe
  80. #note: name.obj and name.exe must match
  81. #
  82. #referencing makefiles depend on the .obj files and not the .cpp files
  83. .obj.exe:
  84.     if not exist $(_OUTDIR) md $(_OUTDIR)
  85. #    $(_LINK) $(_LFLAGS) $(_LIBS) $*.obj
  86.     $(_LINK) $(_LFLAGS) $(_LIBS) /out:$(_OUTDIR)\$@ $**
  87.  
  88. #default compile and link for c++ files building a dll
  89. #note: name.obj and name.dll must match
  90. #
  91. #referencing makefiles depend on the .obj files and not the .cpp files
  92. .obj.dll:
  93.     if not exist $(_OUTDIR) md $(_OUTDIR)
  94.     $(_LINK) $(_LDFLAGS) $(_LIBS) /out:$(_OUTDIR)\$@ $**
  95.  
  96. #default compiling vb files
  97. #note: name.vb and name.dll must match
  98. .vb.dll:
  99.     if not exist $(_OUTDIR) md $(_OUTDIR)
  100.     $(_BC) $(_VB_DLL_FLAGS) $(_IMPORTS) /out:$(_OUTDIR)\$@ $*.vb
  101.  
  102. .vb.exe:
  103.     if not exist $(_OUTDIR) md $(_OUTDIR)
  104.     $(_BC) $(_VB_EXE_FLAGS) $(_IMPORTS)  /out:$(_OUTDIR)\$@ $*.vb
  105.  
  106. #default compiling cool files
  107. #note: name.cs and name.dll must match
  108. #note: we will create the output dir if it does not exist
  109. .cs.dll:
  110.     if not exist $(_OUTDIR) md $(_OUTDIR)
  111.     $(_CS) $(_CS_DLL_FLAGS) $(_IMPORTS) /out:$(_OUTDIR)\$@ $** $(_WIN32RES) $(_KEYFILE)
  112.  
  113.  
  114. #default compiling cool files
  115. #note: name.cs and name.exe must match
  116. .cs.exe:
  117.     if not exist $(_OUTDIR) md $(_OUTDIR)
  118.     $(_CS) $(_CS_EXE_FLAGS) $(_IMPORTS) /out:$(_OUTDIR)\$@ $** $(_WIN32RES) $(_KEYFILE)    
  119.  
  120.  
  121. #default importing tlb files
  122. #note: name.tlb and name.dll must match
  123. .tlb.dll:
  124.     $(_TLBIMP) $*.tlb
  125.  
  126. #default registering dlls
  127. #note: name.tlb and name.reg must match
  128. .dll.reg:
  129.     $(_COMREG) $*.dll
  130.  
  131. #.dll.reg:
  132. #    $(_COMREG) $*.dll
  133. #    $(_TLBEXP) $*.dll
  134.  
  135. #default for registering an ocx
  136.  
  137. .ocx.reg:
  138.     $(_REGSVR) /s $*.ocx
  139.  
  140. #define for compiling il to an exe
  141. .il.exe:
  142.     $(_ASSEM) $*.il
  143.  
  144. #define for compiling il to a dll
  145. .il.dll:
  146.     $(_ASSEM) $*.il /DLL
  147.  
  148. #define for compiling asm to an exe
  149. .asm.exe:
  150.     $(_ASSEM) $*.asm
  151.  
  152. #define for compiling asm to an exe
  153. .asm.dll:
  154.     $(_ASSEM) $*.asm /DLL
  155.  
  156. .res.rc:
  157.    $(_RSC) $**
  158.  
  159. default:    
  160.     nmake all
  161. clean : 
  162.     @-del /Q *.obj *.tlb *.reg
  163.  
  164. clobber :    clean
  165.         @-del /Q *.exe *.dll
  166.  
  167.