kcommondefs
6.74 KB
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
231
232
233
234
235
236
237
238
# Copyright 1986-1994, Silicon Graphics Inc., Mountain View, CA.
#
# kcommondefs - contains basic common flags/locations for kernel builds
# ALL makefiles should include this - so that builds may be done in any
# directory
#
# DEPTH - should be set in the top of each Makefile - it spells the ".."
# path up to top level directory
#
#ident "$Revision: 1.1 $"
include $(ROOT)/usr/include/make/commondefs
#if defined(PRODUCT) && ! empty(PRODUCT)
ifdef PRODUCT
include $(PRODUCTDEFS)
endif
EVERYPRODUCT=4D80T 4D20 4D30 4D100 4D510 4D40 EVEREST 4DACE1 4DACENEX
KCOMMONTARGS= $(COMMONTARGS) lint
KCOMMONPREF=k
#
# We define a postop idb which should be used whenever we want to ensure
# that a reconfig will occur: it avoids any local system time problems
# by changing the old kernel date back to the epoch.
# XXX we should fix inst to sanity-check the mtime of /unix and other
# XXX important files against current time
#
LBOOT=$(TOOLROOT)/usr/sbin/lboot
LBOOTPOSTOP=-idb 'postop("touch -c 0101000000 $$rbase/unix || true")'
# setsym information
SETSYM=$(TOOLROOT)/usr/sbin/setsym
#
# Compile Time Options - use KCDEFS, KCINCS, and KCOPTS in makefiles which
# include kcommondefs
# The kernel can be compiled in 3 different mode:
# _K32U32 - kernel in 32 bit mode running only 32 bit binaries
# _K32U64 - kernel in 32 bit mode running 32/64 bit binaries
# _K64U64 - kernel in 64 bit mode running 32/64 bit binaries
#
KMODEOPT?=-D_K32U32
#
# The default virtual page size is 4KB. The only other page size
# currently supported is 16KB.
#
PGSZOPT?=-D_PAGESZ=4096
#if defined(PRODUCT) && !empty(PRODUCT)
#if $(CPUBOARD) == "IP5"
PRODCDEFS=-D_MP_NETLOCKS
#endif
#if $(CPUBOARD) == "IP17Z"
PRODCDEFS=-DIP17 -DJUMP_WAR -DPROBE_WAR -DBADVA_WAR
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP17P"
PRODCDEFS=-DIP17 -DJUMP_WAR -DPROBE_WAR -DBADVA_WAR
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP17Q"
PRODCDEFS=-DIP17 -DJUMP_WAR -DPROBE_WAR -DBADVA_WAR
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP17"
PRODCDEFS=-DJUMP_WAR -DPROBE_WAR -DBADVA_WAR
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP19"
PRODCDEFS=-DEVEREST -DBADVA_WAR -DMP_R4000_BADVA_WAR -D_MP_NETLOCKS \
-DECC_RECOVER -D_ATOMIC_OPS
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP19P"
PRODCDEFS=-DIP19 -DEVEREST -DBADVA_WAR -DMP_R4000_BADVA_WAR -DECC_RECOVER
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP19Q"
PRODCDEFS=-DIP19 -DEVEREST -DBADVA_WAR -DMP_R4000_BADVA_WAR -DECC_RECOVER
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP19S"
PRODCDEFS=-DIP19 -DSABLE -DEVEREST -DBADVA_WAR -DECC_RECOVER
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
LBOOTOPTS=-v -D
#endif
#if $(CPUBOARD) == "IP20"
PRODCDEFS=-DJUMP_WAR -DPROBE_WAR -DBADVA_WAR -D_MEM_PARITY_WAR
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP21"
#if $(KMODEOPT) == _K32U32 || $(KMODEOPT) == _K32U64
# STAT_TIME is required for 32-bit TFP kernels, since the locore code which
# manages the timers can't afford to get a tlbmiss on the 32-bit sign
# extended addresses.
PRODCDEFS=-DEVEREST -DNO_WIRED_SEGMENTS -DTFP_TLBCACHE_WAR -DSABLE -DSTAT_TIME
#else
PRODCDEFS=-DEVEREST -DNO_WIRED_SEGMENTS -DTFP_TLBCACHE_WAR -DSABLE
#endif
PRODASOPTS=-mips3 -32bit -Wb,-diag
LBOOTOPTS=-v -D
#endif
#if $(CPUBOARD) == "IP21P"
PRODCDEFS=-DIP21 -DEVEREST -DNO_WIRED_SEGMENTS -DTFP_TLBCACHE_WAR -DSABLE
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#if $(CPUBOARD) == "IP22"
PRODCDEFS=-DJUMP_WAR -DPROBE_WAR -DBADVA_WAR -D_VCE_AVOIDANCE \
-D_R4600_CACHEOP_WAR -D_TLB_LOOP_LIMIT -D_MEM_PARITY_WAR \
-D_R4600_2_0_CACHEOP_WAR
PRODCOPTS=-mips2
PRODASOPTS=-mips3 -32bit -Wb,-diag
#endif
#endif
LBOOTOPTS?=-v
GNUMVAL= 8
GKDEFS= $(KMODEOPT) $(PGSZOPT) -D_KERNEL -DSTATIC=static $(DBOPTS) $(PRODCDEFS) -D$(COMPLEX) -D$(CPUBOARD) -D$(CPUARCH) $(CPUARCH_PRODDEFS) -D_IRIX5_1
GKOPTS= -non_shared -coff
GKCOPTS=$(PRODCOPTS)
GKASOPTS=$(PRODASOPTS) -Wb,-coff
LCDEFS= $(KCDEFS) $(GKDEFS)
LCINCS= $(KCINCS) -I$(DEPTH)
LCOPTS= $(KCOPTS) -Wx,-G$(GNUMVAL) $(GKOPTS) $(GKCOPTS)
LASDEFS=$(KASDEFS) $(GKDEFS)
LASINCS=$(KASINCS) -I$(DEPTH)
LASOPTS=$(KASOPTS) -Wx,-G$(GNUMVAL) $(GKOPTS) $(GKASOPTS)
LDFLAGS= $(KLDFLAGS) -G $(GNUMVAL) -coff -non_shared
MKDEPFILE=$(KPATH)/Makedepend.$(CPUBOARD)
#
# Lint options
#
LINTCFLAGS= $(CVERSION) $(ENDIAN) $(CDEFS) $(CINCS) -u -n -woff 91,102,302,307
LINTLDFLAGS= -u -n -woff 91,102
#
# Pathnames for lboot/objects
#
SYSGENDIR=/usr/sysgen
BOOTAREA=$(DEPTH)/$(CPUBOARD)bootarea
CPUINSTDIR=$(SYSGENDIR)/$(CPUBOARD)boot
BOOTDIR=$(SYSGENDIR)/boot
MASTERDIR=$(SYSGENDIR)/master.d
MTUNEDIR=$(SYSGENDIR)/mtune
SHIP_SYSGENDIR=/var/sysgen
SHIP_CPUINSTDIR=/usr/cpu/sysgen/$(CPUBOARD)boot
SHIP_MASTERDIR=$(SHIP_SYSGENDIR)/master.d
SHIP_MTUNEDIR=$(SHIP_SYSGENDIR)/mtune
# full path here so can override in klocaldefs
STUNEFILE=$(ROOT)/$(SYSGENDIR)/stune
SHIP_STUNEFILE=$(ROOT)/$(SHIP_SYSGENDIR)/stune
# lint object area
LINTBOOTAREA=$(DEPTH)/lintbootarea
#
# relative level from BOOTAREA to top of source
#
TOP=..
#
# Kernel install rule for production (shipped) objects
#
KINSTALL=$(INSTALL) -F $(SHIP_CPUINSTDIR) -m 444 -idb "nostrip mach(CPUBOARD=$(CPUBOARD))"
KNOMODEINSTALL=$(INSTALL) -F $(SHIP_CPUINSTDIR) -idb "nostrip mach(CPUBOARD=$(CPUBOARD))"
#
# Kernel install rule for developer objects
#
KDEVINSTALL=$(INSTALL) -F $(CPUINSTDIR) -m 444 -idb nostrip
KNOMODEDEVINSTALL=$(INSTALL) -F $(CPUINSTDIR) -idb nostrip
#
# Kernel install rule for putting object into $(ROOT)/$(CPUINSTDIR)
# this needs to NEVER have RAWIDB set
#
KLINKINSTALL=RAWIDB= $(INSTALL) -F $(CPUINSTDIR) -m 444 -idb nostrip
#
# All low level makefiles will execute this rule for the default build case
#
TARGETRULE= \
cd $(BOOTAREA); \
exec $(MAKE) -f $(KPATH)/Makefile targets DEPTH=$(TOP)
#
# SUBDIRS_MAKERULE that can handle a unset SUBDIRS variable
# and an arbitrary RULE
#
KSUBDIRS_MAKERULE= \
if [ -n "${SUBDIRS}" ]; then \
SUBD="${SUBDIRS}" ;\
for d in $${SUBD}; do $(SUBDIR_MAKERULE); done; \
fi
#
# Allows same sources to be compiled twice with different flags.
# Original Makefile must define TLINKDIR and TL_MAKEFILE before including
# kcommondefs. The two Makefiles must specify different TARGET names.
#
TLINKDIR_MAKERULE= \
if [ -n "${TLINKDIR}" -a -n "${TL_MAKEFILE}" ]; then\
if [ -d $(TLINKDIR) ]; then rm -rf $(TLINKDIR); fi; \
tlink -r -x '^$(TLINKDIR)' -x '^Make.*' . $(TLINKDIR); \
echo "\tcd $(TLINKDIR); $(MAKE) $${RULE:=$@}"; \
cd $(TLINKDIR); ln -s ../$(TL_MAKEFILE) ./Makefile; \
${MAKE} $${RULE:=$@}; \
fi
#
# default is ALWAYS the MAIN target - by specifying it here we need not
# worry about ordering in the makefile
#
.MAIN:default
sinclude $(DEPTH)/klocaldefs