-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSTARTUP.MK
230 lines (188 loc) · 5.56 KB
/
STARTUP.MK
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# MSDOS DMAKE startup file. Customize to suit your needs.
# Assumes MKS toolkit for the tool commands, and Zortech C. Change as req'd.
# See the documentation for a description of internally defined macro#
# Disable warnings for macros redefined here that were given
# on the command line.
__.SILENT := $(.SILENT)
.SILENT := yes
# Configuration parameters for DMAKE startup.mk file
# Set these to NON-NULL if you wish to turn the parameter on.
_HAVE_RCS := yes # yes => RCS is installed.
_HAVE_SCCS := # yes => SCCS is installed.
# Applicable suffix definitions
A := .lib # Libraries
E := .exe # Executables
F := .for # Fortran
O := .obj # Objects
P := .pas # Pascal
S := .asm # Assembler sources
V := # RCS suffix
# See if these are defined
TMPDIR := $(ROOTDIR)/tmp
.IMPORT .IGNORE : TMPDIR SHELL COMSPEC
# Recipe execution configurations
# First set SHELL, If it is not defined, use COMSPEC, otherwise
# it is assumed to be MKS Korn SHELL.
.IF $(SHELL) == $(NULL)
.IF $(COMSPEC) == $(NULL)
SHELL := $(ROOTDIR)/bin/sh$E
.ELSE
SHELL := $(COMSPEC)
.END
.END
GROUPSHELL := $(SHELL)
# Now set remaining arguments depending on which SHELL we
# are going to use. COMSPEC (assumed to be command.com) or
# MKS Korn Shell.
.IF $(SHELL)==$(COMSPEC)
SHELLFLAGS := $(SWITCHAR)c
GROUPFLAGS := $(SHELLFLAGS)
SHELLMETAS := *"?<>
GROUPSUFFIX := .bat
DIRSEPSTR := \\
DIVFILE = $(TMPFILE:s,/,\)
.ELSE
SHELLFLAGS := -c
GROUPFLAGS :=
SHELLMETAS := *"?<>|()&][$$\#`'
GROUPSUFFIX := .ksh
.MKSARGS := yes
DIVFILE = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}})
DIVSEP_shell_yes := \\\
DIVSEP_shell_no := \\
.END
# Standard C-language command names and flags
CC := wcl386 # C-compiler and flags
CFLAGS +=
AS := tasm31 # Assembler and flags
ASFLAGS +=
LD = wlink # Loader and flags
LDFLAGS +=
LDLIBS =
# Definition of $(MAKE) macro for recursive makes.
MAKE = $(MAKECMD) $(MFLAGS)
# Language and Parser generation Tools and their flags
YACC := yacc # standard yacc
YFLAGS +=
YTAB := ytab # yacc output files name stem.
LEX := lex # standard lex
LFLAGS +=
LEXYY := lex_yy # lex output file
# Other Compilers, Tools and their flags
PC := any_pc # pascal compiler
RC := anyf77 # ratfor compiler
FC := anyf77 # fortran compiler
CO := co # check out for RCS
COFLAGS += -q
AR := ar # archiver
ARFLAGS+= ruv
RM := del # remove a file command
RMFLAGS +=
# Implicit generation rules for making inferences.
# We don't provide .yr or .ye rules here. They're obsolete.
# Rules for making *$O
%$O : %.c ; $(CC) $(CFLAGS) -c $<
%$O : %.cpp ; $(CC) $(CFLAGS) -c $<
%$O : %$P ; $(PC) $(PFLAGS) -c $<
%$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\);
%$O : %.cl ; class -c $<
%$O : %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
# Executables
%$E : %$O ; $(CC) @$(mktmp,a.lnk $(LDFLAGS) $< $(LDLIBS))
# lex and yacc rules
%.c : %.y ; $(YACC) $(YFLAGS) $<; mv $(YTAB).c $@
%.c : %.l ; $(LEX) $(LFLAGS) $<; mv $(LEXYY).c $@
# RCS support
.IF $(_HAVE_RCS)
% : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@
.NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V
.END
# SCCS support
.IF $(_HAVE_SCCS)
% : s.% ; get $<
.NOINFER : s.%
.END
# Recipe to make archive files.
%$A :
[
$(AR) $(ARFLAGS) $@ $?
$(RM) $(RMFLAGS) $?
]
# DMAKE uses this recipe to remove intermediate targets
.REMOVE :; $(RM) $<
# AUGMAKE extensions for SYSV compatibility
@B = $(@:b)
@D = $(@:d)
@F = $(@:f)
"*B" = $(*:b)
"*D" = $(*:d)
"*F" = $(*:f)
<B = $(<:b)
<D = $(<:d)
<F = $(<:f)
#?B = $(?:b)
#?F = $(?:f)
#?D = $(?:d)
# watcom dir
WINC =C:\watcom\h\
# Turn warnings back to previous setting.
.SILENT := $(__.SILENT)
# Local init file if any, gets parsed before user makefile
.INCLUDE .IGNORE: "_startup.mk"
# this is my stuff
# what the various flags do
# fp5 - floating point inlined for pentium
# 5r - pentium register passing
# s - remove stack check
# mf - flat memory model
# zq - operate quietly
# wx - all warnings on
# d1 - simple debug info, shouldn`t affect code
# d1+ - as above, but with unused names
# 5s - pentium stack passing
# zp4 - pack structures to 4 bytes
# hc - do codeview style debug info
# oneatx - watcom recommended optimizations for pentium (see below)
# ee ep - add epilogue, prolog hooks for profiler
# et - add rdtsc style profiler hooks
# /o optimizations
# t -
# e -
# x -
# e -
# a -
# n -
# i -
# l -
# r -
# + -
#CFLAGS = /oanrlt /fp5 /5r /s /mf /zq /wx
#CFLAGS = /oanrlt /d2 /fp5 /5r /mf /zq /wx
#CFLAGS = /oanrlt /fp5 /5r /mf /zq /wx
#CFLAGS = /d2 /fp5 /5s /mf /zq /wx
# watcom pentium rec.
#CFLAGS = /oneatx /zp4 /5r /fp5 /s /mf /wx
#CFLAGS = /oneatx /zp4 /5r /fp5 /s /mf /wx
# for debugging pentium stuff
#CFLAGS = /d3 /zp4 /5r /fp5 /mf /wx
# for vtune
#CFLAGS = /hc /d2 /zp4 /5 /fp5 /s /mf /wx /oneatx
# 486
#CFLAGS = /oneatx /zp4 /4 /fp3 /s /mf /wx
# 386
#CFLAGS = /oneatx /zp4 /3 /fp3 /s /mf /wx
# super inlining
#CFLAGS = /d1 /otiexanl+ /fp5 /5r /s /mf /zq /wx
# for mesa
CFLAGS = /d2 /5r /fp5 /wx /DDEBUG
#CFLAGS = /otexan /zp4 /mf /5r /fp5 /wx /d1+
PROFILE = /ee /ep
#CFLAGS += $(PROFILE)
PPROF = /et
#CFLAGS += $(PPROF)
# 3dfx
#CFLAGS += /DGLIDE_HARDWARE
#CFLAGS += /D_PC_=1
#CFLAGS += /D_586_ /D__586__
ASMFLAGS = /ml /m5 /zi /p /r /t /z /w2 /kh10000 /i$(@:d)
.IMPORT : WATCOM