vc32.mk 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #############################################################################
  2. #
  3. # SciTech Multi-platform Graphics Library
  4. #
  5. # ========================================================================
  6. #
  7. # The contents of this file are subject to the SciTech MGL Public
  8. # License Version 1.0 (the "License"); you may not use this file
  9. # except in compliance with the License. You may obtain a copy of
  10. # the License at http://www.scitechsoft.com/mgl-license.txt
  11. #
  12. # Software distributed under the License is distributed on an
  13. # "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  14. # implied. See the License for the specific language governing
  15. # rights and limitations under the License.
  16. #
  17. # The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
  18. #
  19. # The Initial Developer of the Original Code is SciTech Software, Inc.
  20. # All Rights Reserved.
  21. #
  22. # ========================================================================
  23. #
  24. # Descripton: Rules makefile definitions, which define the rules used to
  25. # build targets. We include them here at the end of the
  26. # makefile so the generic project makefiles can override
  27. # certain things with macros (such as linking C++ programs
  28. # differently).
  29. #
  30. #############################################################################
  31. # Turn on pre-compiled headers as neccessary
  32. .IF $(PRECOMP_HDR)
  33. CFLAGS += -YX"$(PRECOMP_HDR)"
  34. .ENDIF
  35. # Turn on runtime type information as necessary
  36. .IF $(USE_RTTI)
  37. CFLAGS += /GR
  38. .ENDIF
  39. # Turn on C++ exception handling as necessary
  40. .IF $(USE_CPPEXCEPT)
  41. CFLAGS += /GX
  42. .ENDIF
  43. # Take out PMLIB if we don't need to link with it
  44. .IF $(NO_PMLIB)
  45. PMLIB :=
  46. .ENDIF
  47. # Implicit generation rules for making object files
  48. %$O: %.c ; $(CC) /nologo @$(mktmp $(CFLAGS:s/\/\\)) /c $(<:s,/,\)
  49. %$O: %$P ; $(CC) /nologo @$(mktmp $(CFLAGS:s/\/\\)) /c $(<:s,/,\)
  50. .IF $(USE_NASM)
  51. %$O: %$A ; $(AS) @$(mktmp -o $@ $(ASFLAGS:s/\/\\)) $(<:s,/,\)
  52. .ELSE
  53. %$O: %$A ; $(AS) @$(mktmp $(ASFLAGS:s/\/\\)) $(<:s,/,\)
  54. .ENDIF
  55. # Implicit rule for building resource files
  56. %$R: %.rc ; $(RC) $(RCFLAGS) -r $<
  57. # Implicit rules for building NT device drivers
  58. %.sys: ;
  59. $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
  60. .IF $(DBG)
  61. .IF $(USE_SOFTICE)
  62. $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
  63. .ENDIF
  64. .ENDIF
  65. # Implicit rule for building a DLL using a response file
  66. .IF $(IMPORT_DLL)
  67. .ELSE
  68. .IF $(NO_RUNTIME)
  69. %$D: ; $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
  70. .ELSE
  71. %$D: ;
  72. makedef -v $*
  73. $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
  74. .IF $(DBG)
  75. .IF $(USE_SOFTICE)
  76. $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
  77. .ENDIF
  78. .ENDIF
  79. .ENDIF
  80. .ENDIF
  81. # Implicit rule for building a library file using response file. Note that
  82. # we use a special .VCD file that contains the EXPORT definitions for the
  83. # Microsoft compiler, since the LIB utility automatically adds leading
  84. # underscores to exported functions.
  85. .IF $(IMPORT_DLL)
  86. %$L: ;
  87. makedef -v $(?:b)
  88. @$(RM) $@
  89. $(ILIB) $(ILIBFLAGS) /DEF:$(?:b).def /OUT:$@
  90. .ELSE
  91. %$L: ;
  92. @$(RM) $@
  93. $(LIB) $(LIBFLAGS) /out:$@ @$(mktmp $(&:t"\n")\n)
  94. .ENDIF
  95. # Implicit rule for building an executable file using response file
  96. .IF $(USE_WIN32)
  97. %$E: ;
  98. $(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
  99. .IF $(DBG)
  100. .IF $(USE_SOFTICE)
  101. $(NMSYM) $(NMSYMFLAGS);$(SI_SOURCE) $@
  102. .ENDIF
  103. .ENDIF
  104. .ELSE
  105. %$E: ;
  106. @$(LD) /nologo @$(mktmp $(LDFLAGS) /Fe$@ $(&:t"\n"s/\/\\) $(PMLIB) $(EXELIBS) $(DEF_LIBS) $(LDENDFLAGS))
  107. .IF $(DOSSTYLE)
  108. @markphar $@
  109. .ENDIF
  110. .ENDIF