home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / master.mak < prev   
Encoding:
Text File  |  2000-06-11  |  4.1 KB  |  172 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. #Allow builds with custom compiler path
  14. !IFDEF CUST_CS
  15. _CS=$(CUST_CS)
  16. !ENDIF
  17.  
  18. #define the names of some common tools
  19. _TLBIMP=tlbimp.exe
  20. _TLBEXP=tlbexp.exe
  21. _REGASM=regasm.exe
  22. _REGSVR=regsvr32.exe
  23. _RSC=rc.exe
  24.  
  25. #define our basic link line for managed code
  26. _LINK=link.exe /entry:main
  27.  
  28. #define our basic core lib
  29. _LIBS=mscoree.lib
  30.  
  31. #this is used for compiling cool samples
  32. #reset this in individual sample makefile to your imports if required
  33. _IMPORTS=
  34.  
  35. #this is used for compiling cool samples, that use Resources
  36. #reset this in individual sample makefile to your resource imports if required
  37. _WIN32RES=
  38.  
  39. #This is used for compiling cool samples that use Assembly and key files
  40. #reset this in individual sample makefile to your resource imports if required
  41. _KEYFILE=
  42.  
  43. #this is used for compiling cool samples
  44. #set the default out directory to .
  45. _OUTDIR=.
  46.  
  47. #Set what to clean by default
  48. #Allow builds with custom compiler path
  49. !IFNDEF _CLEANFILES
  50. _CLEANFILES=*.obj *.tlb *.reg
  51. !ENDIF
  52.  
  53. #set some command C++ flags
  54. _CCFLAGS=/com+ 
  55. _CFLAGS=$(_CCFLAGS) /c
  56.  
  57. #set debug as the default for c++
  58. _CDFLAGS=$(_CFLAGS) /Zi 
  59.  
  60. #set some command link flags
  61. _LFLAGS=-noentry
  62. _LDFLAGS=-noentry -dll
  63.  
  64. _CS_DLL_FLAGS=/t:library /debug+ $(TRACE)
  65. _CS_EXE_FLAGS=/debug+  $(TRACE)
  66.  
  67. _VB_DLL_FLAGS=/t:library /debug+ $(TRACE)
  68. _VB_EXE_FLAGS=/t:exe /debug+  $(TRACE)
  69.  
  70. #default compile and link for c++ files building a dll
  71. #note: name.cpp and name.dll must match
  72. .cpp.dll:
  73.     if not exist $(_OUTDIR) md $(_OUTDIR)
  74.     $(_CL) $(_CDFLAGS) $*.cpp
  75.     $(_LINK) $(_LDFLAGS) $(_LIBS) $*.obj
  76.  
  77. #default compile and link for c++ files building a exe
  78. #note: name.cpp and name.dll must match
  79. .cpp.exe:
  80.     if not exist $(_OUTDIR) md $(_OUTDIR)
  81.     $(_CL) $(_CDFLAGS) $*.cpp
  82.     $(_LINK) $(_LFLAGS) $(_LIBS) $*.obj
  83.  
  84. #default compile and link for c++ files building an obj
  85. #note: name.cpp and name.obj must match
  86. .cpp.obj:    
  87.     $(_CL) $(_CDFLAGS) $*.cpp
  88.  
  89. #default compile and link for c++ files building an exe
  90. #note: name.obj and name.exe must match
  91. .obj.exe:
  92. #    $(_LINK) $(_LFLAGS) $(_LIBS) $*.obj
  93.     $(_LINK) $(_LFLAGS) $(_LIBS) $**
  94.  
  95. #default compile and link for c++ files building a dll
  96. #note: name.obj and name.dll must match
  97. .obj.dll:
  98.     $(_LINK) $(_LDFLAGS) $(_LIBS) $*.obj
  99.  
  100. #default compiling vb files
  101. #note: name.vb and name.dll must match
  102. .vb.dll:
  103.     if not exist $(_OUTDIR) md $(_OUTDIR)
  104.     $(_BC) $(_VB_DLL_FLAGS) $(_IMPORTS)  /out:$(_OUTDIR)\$@ $** $(_WIN32RES) $(_KEYFILE)
  105.  
  106. .vb.exe:
  107.     if not exist $(_OUTDIR) md $(_OUTDIR)
  108.     $(_BC) $(_VB_EXE_FLAGS) $(_IMPORTS)  /out:$(_OUTDIR)\$@ $** $(_WIN32RES) $(_KEYFILE)
  109.  
  110. #default compiling cool files
  111. #note: name.cs and name.dll must match
  112. #note: we will create the output dir if it does not exist
  113. .cs.dll:
  114.     if not exist $(_OUTDIR) md $(_OUTDIR)
  115.     $(_CS) $(_CS_DLL_FLAGS) $(_IMPORTS) /out:$(_OUTDIR)\$@ $** $(_WIN32RES) $(_KEYFILE)
  116.  
  117.  
  118. #default compiling cool files
  119. #note: name.cs and name.exe must match
  120. .cs.exe:
  121.     if not exist $(_OUTDIR) md $(_OUTDIR)
  122.     $(_CS) $(_CS_EXE_FLAGS) $(_IMPORTS) /out:$(_OUTDIR)\$@ $** $(_WIN32RES) $(_KEYFILE)    
  123.  
  124.  
  125. #default importing tlb files
  126. #note: name.tlb and name.dll must match
  127. .tlb.dll:
  128.     $(_TLBIMP) /Tlb $*.tlb /Fe $*.dll
  129.  
  130. #default registering dlls
  131. #note: name.tlb and name.reg must match
  132. .dll.reg:
  133.     $(_COMREG) $*.dll
  134.  
  135. #.dll.reg:
  136. #    $(_COMREG) $*.dll
  137. #    $(_TLBEXP) $*.dll
  138.  
  139. #default for registering an ocx
  140.  
  141. .ocx.reg:
  142.     $(_REGSVR) /s $*.ocx
  143.  
  144. #define for compiling il to an exe
  145. .il.exe:
  146.     $(_ASSEM) $*.il
  147.  
  148. #define for compiling il to a dll
  149. .il.dll:
  150.     $(_ASSEM) $*.il /DLL
  151.  
  152. #define for compiling asm to an exe
  153. .asm.exe:
  154.     $(_ASSEM) $*.asm
  155.  
  156. #define for compiling asm to an exe
  157. .asm.dll:
  158.     $(_ASSEM) $*.asm /DLL
  159.  
  160. .res.rc:
  161.    $(_RSC) $**
  162.  
  163. default:    
  164.     nmake all
  165.         
  166. clean : 
  167.     @-del /Q $(_CLEANFILES)
  168.  
  169. clobber :    clean
  170.         @-del /Q *.exe *.dll
  171.  
  172.