summaryrefslogtreecommitdiff
path: root/board/MAI/bios_emulator/scitech/makedefs/common.mk
blob: d337152e74abb4b0338ed90735052f8b4288c6a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
#############################################################################
#
#					SciTech Multi-platform Graphics Library
#
#  ========================================================================
#
#    The contents of this file are subject to the SciTech MGL Public
#    License Version 1.0 (the "License"); you may not use this file
#    except in compliance with the License. You may obtain a copy of
#    the License at http://www.scitechsoft.com/mgl-license.txt
#
#    Software distributed under the License is distributed on an
#    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
#    implied. See the License for the specific language governing
#    rights and limitations under the License.
#
#    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.
#
#    The Initial Developer of the Original Code is SciTech Software, Inc.
#    All Rights Reserved.
#
#  ========================================================================
#
# Descripton:   Common makefile targets used by all SciTech Software
#               makefiles. This file includes targets for cleaning the
#               current directory, and maintaining the source files with
#               RCS.
#
#############################################################################

# Override global OpenGL includes when compiling against MGL version

.IF $(USE_MGL_OPENGL)
.IF $(UNIX_HOST)
CFLAGS		+= -I$(SCITECH)/include/mglgl
DEPEND_INC	+= $(SCITECH)/include/mglgl
.ELSE
CFLAGS		+= -I$(SCITECH)\include\mglgl
DEPEND_INC	+= $(SCITECH)\include/mglgl
.ENDIF
.ENDIF

# Define where to install all compiled DLL files

.IF $(UNIX_HOST)
.IF $(CHECKED)
DLL_DEST    := $(SCITECH_LIB)/redist/debug
.ELSE
DLL_DEST    := $(SCITECH_LIB)/redist/release
.ENDIF
.ELSE
.IF $(CHECKED)
DLL_DEST    := $(SCITECH_LIB)\redist\debug
.ELSE
DLL_DEST    := $(SCITECH_LIB)\redist\release
.ENDIF
.ENDIF

# Target to build the library and DLL file if specified

.IF $(LIBFILE)

lib: $(LIBFILE)

.IF $(DLLFILE)

# Build and install a DLL file, or simply build import library and install

.IF $(BUILD_DLL)

$(DLLFILE): $(OBJECTS)
$(LIBFILE): $(DLLFILE)
install: $(LIBFILE) $(DLLFILE)
	$(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
	$(INSTALL) $(DLLFILE) $(DLL_DEST)
.IF $(USE_SOFTICE)
	$(INSTALL) $(DLLFILE:s/.dll/.nms) $(DLL_DEST)
.ENDIF
.ELSE

$(LIBFILE): $(DLL_DEST)\$(DLLFILE)
install: $(LIBFILE)
	$(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)

.ENDIF
.ELSE

.IF $(BUILD_DLL)

# Build and install a Unix shared library

$(LIBFILE): $(OBJECTS)
install: $(LIBFILE)
	$(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
	$(INSTALL) $(LIBFILE) $(DLL_DEST)/$(LIBFILE).$(VERSION)

.ELSE

# Build and install a normal library file

.IF $(USE_DLL)
.ELSE
$(LIBFILE): $(OBJECTS)
install: $(LIBFILE)
	$(INSTALL) $(LIBFILE) $(LIB_DEST)$(LIB_EXTENDER)
.ENDIF
.ENDIF
.ENDIF
.ENDIF

# Build and install a VxD file, including debug information

.IF $(VXDFILE)
$(VXDFILE:s/.vxd/.dll): $(OBJECTS)
$(VXDFILE): $(VXDFILE:s/.vxd/.dll)
install: $(VXDFILE)
	$(INSTALL) $(VXDFILE) $(DLL_DEST)
.IF $(DBG)
	$(INSTALL) $(VXDFILE:s/.vxd/.nms) $(DLL_DEST)
.ENDIF
.ENDIF

# Clean up directory removing all files not needed to make the library.

__CLEAN_FILES := *.obj *.o *.sym *.bak *.tdk *.swp *.map *.err *.csm *.lib *.aps *.nms *.sys
__CLEAN_FILES += *.~* *.td *.tr *.tr? *.td? *.rws *.res *.exp *.ilk *.pdb *.pch *.a bcc32.*
__CLEAN_FILES += $(LIBCLEAN)
__CLEANEXE_FILES := $(__CLEAN_FILES) *$E *.drv *.rex *.dll *.vxd *.nms *.pel *.smf *.so.*

.PHONY clean:
	@$(RM) -f -S $(mktmp $(__CLEAN_FILES:t"\n"))

.PHONY cleanexe:
	@$(RM) -f -S $(mktmp $(__CLEANEXE_FILES:t"\n"))

# Define the source directories to find common files

.IF $(NO_SCITECH_COMMON)
.ELSE
.SOURCE:		   $(SCITECH)/src/common
.ENDIF

# Create the include file dependencies using the MKUTIL makedep program if
# the list of dependent object files is defined

.IF $(DEPEND_OBJ)
depend:
	@$(RM) -f makefile.dep
.IF $(DEPEND_SRC)
.IF $(DEPEND_INC)
	@makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
.ELSE
	@makedep -amakefile.dep -r -s -S@$(mktmp $(DEPEND_SRC:s/\/\\);$(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
.ENDIF
.ELSE
.IF $(DEPEND_INC)
	@makedep -amakefile.dep -r -s -I@$(mktmp $(DEPEND_INC:s/\/\\)) -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
.ELSE
	@makedep -amakefile.dep -r -s -S@$(mktmp $(SCITECH)/src/common) @$(mktmp $(DEPEND_OBJ:t"\n")\n)
.ENDIF
.ENDIF
	@$(ECHO) Object file dependency information generated.
.ENDIF

# Set up for compiling Snap executeables and dynamic link libraries

.IF $(USE_SNAP)
#CFLAGS     	+= -I$(PRIVATE)\include\drvlib -I$(SCITECH)\include\drvlib -D__SNAP__
CFLAGS     	+= -D__SNAP__
ASFLAGS   	+= -d__SNAP__
#EXELIBS		+= snap$L
.ENDIF

# Include rule definitions for the compiler

.INCLUDE: "$(SCITECH)/makedefs/rules/$(RULES_MAK)"

# Include file dependencies

.INCLUDE .IGNORE: "makefile.dep"