common.mk 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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: Common makefile targets used by all SciTech Software
  25. # makefiles. This file includes targets for cleaning the
  26. # current directory, and maintaining the source files with
  27. # RCS.
  28. #
  29. #############################################################################
  30. # Override global OpenGL includes when compiling against MGL version
  31. .IF $(USE_MGL_OPENGL)
  32. .IF $(UNIX_HOST)
  33. CFLAGS += -I$(SCITECH)/include/mglgl
  34. DEPEND_INC += $(SCITECH)/include/mglgl
  35. .ELSE
  36. CFLAGS += -I$(SCITECH)\include\mglgl
  37. DEPEND_INC += $(SCITECH)\include/mglgl
  38. .ENDIF
  39. .ENDIF
  40. # Define where to install all compiled DLL files
  41. .IF $(UNIX_HOST)
  42. .IF $(CHECKED)
  43. DLL_DEST := $(SCITECH_LIB)/redist/debug
  44. .ELSE
  45. DLL_DEST := $(SCITECH_LIB)/redist/release
  46. .ENDIF
  47. .ELSE
  48. .IF $(CHECKED)
  49. DLL_DEST := $(SCITECH_LIB)\redist\debug
  50. .ELSE
  51. DLL_DEST := $(SCITECH_LIB)\redist\release
  52. .ENDIF
  53. .ENDIF
  54. # Target to build the library and DLL file if specified
  55. .IF $(LIBFILE)
  56. lib: $(LIBFILE)
  57. .IF $(DLLFILE)
  58. # Build and install a DLL file, or simply build import library and install
  59. .IF $(BUILD_DLL)
  60. $(DLLFILE): $(OBJECTS)
  61. $(LIBFILE): $(DLLFILE)
  62. install: $(LIBFILE) $(DLLFILE)
  63. $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
  64. $(INSTALL) $(DLLFILE) $(DLL_DEST)
  65. .IF $(USE_SOFTICE)
  66. $(INSTALL) $(DLLFILE:s/.dll/.nms) $(DLL_DEST)
  67. .ENDIF
  68. .ELSE
  69. $(LIBFILE): $(DLL_DEST)\$(DLLFILE)
  70. install: $(LIBFILE)
  71. $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
  72. .ENDIF
  73. .ELSE
  74. .IF $(BUILD_DLL)
  75. # Build and install a Unix shared library
  76. $(LIBFILE): $(OBJECTS)
  77. install: $(LIBFILE)
  78. $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
  79. $(INSTALL) $(LIBFILE) $(DLL_DEST)/$(LIBFILE).$(VERSION)
  80. .ELSE
  81. # Build and install a normal library file
  82. .IF $(USE_DLL)
  83. .ELSE
  84. $(LIBFILE): $(OBJECTS)
  85. install: $(LIBFILE)
  86. $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
  87. .ENDIF
  88. .ENDIF
  89. .ENDIF
  90. .ENDIF
  91. # Build and install a VxD file, including debug information
  92. .IF $(VXDFILE)
  93. $(VXDFILE:s/.vxd/.dll): $(OBJECTS)
  94. $(VXDFILE): $(VXDFILE:s/.vxd/.dll)
  95. install: $(VXDFILE)
  96. $(INSTALL) $(VXDFILE) $(DLL_DEST)
  97. .IF $(DBG)
  98. $(INSTALL) $(VXDFILE:s/.vxd/.nms) $(DLL_DEST)
  99. .ENDIF
  100. .ENDIF
  101. # Clean up directory removing all files not needed to make the library.
  102. __CLEAN_FILES := *.obj *.o *.sym *.bak *.tdk *.swp *.map *.err *.csm *.lib *.aps *.nms *.sys
  103. __CLEAN_FILES += *.~* *.td *.tr *.tr? *.td? *.rws *.res *.exp *.ilk *.pdb *.pch *.a bcc32.*
  104. __CLEAN_FILES += $(LIBCLEAN)
  105. __CLEANEXE_FILES := $(__CLEAN_FILES) *$E *.drv *.rex *.dll *.vxd *.nms *.pel *.smf *.so.*
  106. .PHONY clean:
  107. @$(RM) -f -S $(mktmp $(__CLEAN_FILES:t"\n"))
  108. .PHONY cleanexe:
  109. @$(RM) -f -S $(mktmp $(__CLEANEXE_FILES:t"\n"))
  110. # Define the source directories to find common files
  111. .IF $(NO_SCITECH_COMMON)
  112. .ELSE
  113. .SOURCE: $(SCITECH)/src/common
  114. .ENDIF
  115. # Create the include file dependencies using the MKUTIL makedep program if
  116. # the list of dependent object files is defined
  117. .IF $(DEPEND_OBJ)
  118. depend:
  119. @$(RM) -f makefile.dep
  120. .IF $(DEPEND_SRC)
  121. .IF $(DEPEND_INC)
  122. @makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
  123. .ELSE
  124. @makedep -amakefile.dep -r -s -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
  125. .ENDIF
  126. .ELSE
  127. .IF $(DEPEND_INC)
  128. @makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
  129. .ELSE
  130. @makedep -amakefile.dep -r -s -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
  131. .ENDIF
  132. .ENDIF
  133. @$(ECHO) Object file dependency information generated.
  134. .ENDIF
  135. # Set up for compiling Snap executeables and dynamic link libraries
  136. .IF $(USE_SNAP)
  137. #CFLAGS += -I$(PRIVATE)\include\drvlib -I$(SCITECH)\include\drvlib -D__SNAP__
  138. CFLAGS += -D__SNAP__
  139. ASFLAGS += -d__SNAP__
  140. #EXELIBS += snap$L
  141. .ENDIF
  142. # Include rule definitions for the compiler
  143. .INCLUDE: "$(SCITECH)/makedefs/rules/$(RULES_MAK)"
  144. # Include file dependencies
  145. .INCLUDE .IGNORE: "makefile.dep"