1 #############################################################################
3 # SciTech Multi-platform Graphics Library
5 # ========================================================================
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
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.
17 # The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
19 # The Initial Developer of the Original Code is SciTech Software, Inc.
20 # All Rights Reserved.
22 # ========================================================================
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
29 #############################################################################
31 # Override global OpenGL includes when compiling against MGL version
35 CFLAGS += -I$(SCITECH)/include/mglgl
36 DEPEND_INC += $(SCITECH)/include/mglgl
38 CFLAGS += -I$(SCITECH)\include\mglgl
39 DEPEND_INC += $(SCITECH)\include/mglgl
43 # Define where to install all compiled DLL files
47 DLL_DEST := $(SCITECH_LIB)/redist/debug
49 DLL_DEST := $(SCITECH_LIB)/redist/release
53 DLL_DEST := $(SCITECH_LIB)\redist\debug
55 DLL_DEST := $(SCITECH_LIB)\redist\release
59 # Target to build the library and DLL file if specified
67 # Build and install a DLL file, or simply build import library and install
71 $(DLLFILE): $(OBJECTS)
72 $(LIBFILE): $(DLLFILE)
73 install: $(LIBFILE) $(DLLFILE)
74 $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
75 $(INSTALL) $(DLLFILE) $(DLL_DEST)
77 $(INSTALL) $(DLLFILE:s/.dll/.nms) $(DLL_DEST)
81 $(LIBFILE): $(DLL_DEST)\$(DLLFILE)
83 $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
90 # Build and install a Unix shared library
92 $(LIBFILE): $(OBJECTS)
94 $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
95 $(INSTALL) $(LIBFILE) $(DLL_DEST)/$(LIBFILE).$(VERSION)
99 # Build and install a normal library file
103 $(LIBFILE): $(OBJECTS)
105 $(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
111 # Build and install a VxD file, including debug information
114 $(VXDFILE:s/.vxd/.dll): $(OBJECTS)
115 $(VXDFILE): $(VXDFILE:s/.vxd/.dll)
117 $(INSTALL) $(VXDFILE) $(DLL_DEST)
119 $(INSTALL) $(VXDFILE:s/.vxd/.nms) $(DLL_DEST)
123 # Clean up directory removing all files not needed to make the library.
125 __CLEAN_FILES := *.obj *.o *.sym *.bak *.tdk *.swp *.map *.err *.csm *.lib *.aps *.nms *.sys
126 __CLEAN_FILES += *.~* *.td *.tr *.tr? *.td? *.rws *.res *.exp *.ilk *.pdb *.pch *.a bcc32.*
127 __CLEAN_FILES += $(LIBCLEAN)
128 __CLEANEXE_FILES := $(__CLEAN_FILES) *$E *.drv *.rex *.dll *.vxd *.nms *.pel *.smf *.so.*
131 @$(RM) -f -S $(mktmp $(__CLEAN_FILES:t"\n"))
134 @$(RM) -f -S $(mktmp $(__CLEANEXE_FILES:t"\n"))
136 # Define the source directories to find common files
138 .IF $(NO_SCITECH_COMMON)
140 .SOURCE: $(SCITECH)/src/common
143 # Create the include file dependencies using the MKUTIL makedep program if
144 # the list of dependent object files is defined
148 @$(RM) -f makefile.dep
151 @makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
153 @makedep -amakefile.dep -r -s -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
157 @makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
159 @makedep -amakefile.dep -r -s -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
162 @$(ECHO) Object file dependency information generated.
165 # Set up for compiling Snap executeables and dynamic link libraries
168 #CFLAGS += -I$(PRIVATE)\include\drvlib -I$(SCITECH)\include\drvlib -D__SNAP__
170 ASFLAGS += -d__SNAP__
174 # Include rule definitions for the compiler
176 .INCLUDE: "$(SCITECH)/makedefs/rules/$(RULES_MAK)"
178 # Include file dependencies
180 .INCLUDE .IGNORE: "makefile.dep"