This repository has been archived by the owner on Oct 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile.master
executable file
·314 lines (283 loc) · 8.6 KB
/
Makefile.master
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
#
#ident "@(#)Makefile.master 1.71 95/07/16 SMI"
#
# Copyright (c) 1993 by Sun Microsystems, Inc.
#
# Makefile.master, global definitions for system source
#
ROOT= /proto
# CH toggles operations restricted to root. It is normally set to `#'. When
# running as root, it should be set to `' (null).
#
# RELEASE_BUILD should be cleared for final release builds. This is completely
# independent of CH. NOT_RELEASE_BUILD is exactly what the name implies.
#
# INTERNAL_RELEASE_BUILD is a subset of RELEASE_BUILD. It mostly controls
# identification strings. Enabling RELEASE_BUILD automatically enables
# INTERNAL_RELEASE_BUILD.
#
# STRIP_COMMENTS toggles comment section striping. Generally the same setting
# as INTERNAL_RELEASE_BUILD.
#
# BUILD_PROFS toggles the building of profiled libraries. Again, generally
# the same setting as INTERNAL_RELEASE_BUILD.
#
# STRIPFLAG is similar. It is set to a unique value depending upon the
# value of CH. It is set here for use in lower level Makefiles to allow
# a single point change to effect the entire build.
#
CH:sh= echo \\043
NOT_RELEASE_BUILD=
INTERNAL_RELEASE_BUILD:sh= echo \\043
RELEASE_BUILD:sh= echo \\043
$(RELEASE_BUILD)NOT_RELEASE_BUILD:sh= echo \\043
$(RELEASE_BUILD)INTERNAL_RELEASE_BUILD=
STRIP_COMMENTS= $(INTERNAL_RELEASE_BUILD)
BUILD_PROFS= $(INTERNAL_RELEASE_BUILD)
STRIPFLAG=
$(CH)STRIPFLAG= -s
RPCGEN= rpcgen
ECHO= echo
INS= install
SYMLINK= ln -s
LN= ln
CHMOD= chmod
CHOWN= $(ECHO)
$(CH)CHOWN= chown -h
CHGRP= $(ECHO)
$(CH)CHGRP= chgrp -h
MV= mv -f
RM= rm -f
MCS= mcs
FILEMODE= 644
DIRMODE= 755
OWNER= bin
GROUP= bin
# Declare that nothing should be built in parallel.
# Individual Makefiles can use the .PARALLEL target to declare otherwise.
.NO_PARALLEL:
# For stylistic checks
#
# Note that the X and C checks are not used at this time and may need
# modification when they are actually used.
#
CSTYLE= cstyle
CSTYLE_TAIL=
HDRCHK= hdrchk
HDRCHK_TAIL=
DOT_H_CHECK= \
@$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL); \
$(HDRCHK) $< $(HDRCHK_TAIL)
DOT_X_CHECK= \
@$(ECHO) "checking $<"; $(RPCGEN) -C -h $< | $(CSTYLE) $(CSTYLE_TAIL); \
$(RPCGEN) -C -h $< | $(HDRCHK) $< $(HDRCHK_TAIL)
DOT_C_CHECK= \
@$(ECHO) "checking $<"; $(CSTYLE) $< $(CSTYLE_TAIL)
# modified for use within NSE environments
#
INS.file= $(RM) $@; $(INS) -s -m $(FILEMODE) -f $(@D) $<
$(CH)INS.file= $(INS) -s -m $(FILEMODE) -u $(OWNER) -g $(GROUP) -f $(@D) $<
INS.dir= $(INS) -s -d -m $(DIRMODE) $@
$(CH)INS.dir= $(INS) -s -d -m $(DIRMODE) -u $(OWNER) -g $(GROUP) $@
# installs and renames at once
#
INS.rename= $(INS.file); $(MV) $(@D)/$(<F) $@
# MACH must be set in the shell environment per uname -p on the build host
# More specific architecture variables should be set in lower makefiles.
# In most places, assignments to these macros should be appended with +=
# (CPPFLAGS.master allows values to be prepended to CPPFLAGS).
# Optimization is toggleable in lower level makefiles via the COPTFLAG macro.
#
sparc_CFLAGS= -xcg89 -Wa,-cg92
i386_CFLAGS=
COPTFLAG= -O
CFLAGS= $(COPTFLAG) $($(MACH)_CFLAGS)
DTEXTDOM=-DTEXT_DOMAIN=\"$(TEXT_DOMAIN)\" # For messaging.
CPPFLAGS.master=$(DTEXTDOM) \
$(ENVCPPFLAGS1) $(ENVCPPFLAGS2) $(ENVCPPFLAGS3) $(ENVCPPFLAGS4)
CPPFLAGS= $(CPPFLAGS.master)
AS_CPPFLAGS= $(CPPFLAGS.master)
#
# For source message catalogue
#
.SUFFIXES: $(SUFFIXES) .po
MSGROOT= $(ROOT)/catalog
MSGDOMAIN= $(MSGROOT)/$(TEXT_DOMAIN)
CLOBBERFILES += $(POFILE) $(POFILES)
COMPILE.cpp= $(CC) -E -C $(CFLAGS) $(CPPFLAGS)
XGETTEXT= xgettext
XGETFLAGS= -c TRANSLATION_NOTE
BUILD.po= $(XGETTEXT) $(XGETFLAGS) $<.i ;\
$(RM) $@ ;\
sed "/^domain/d" < messages.po > $@ ;\
$(RM) messages.po $<.i
#
# This is overwritten by local Makefile when PROG is a list.
#
POFILE= $(PROG).po
# The C++ translation system (can't bring myself to call it a compiler),
# doesn't understand the ANSI and K&R C keyword "signed". The following
# flag settings silence warnings about this. Hopefully, this will be fixed.
#
sparc_CCFLAGS= -cg89 -Qoption fbe -cg92
i386_CCFLAGS=
CCOPTFLAG= -O
CCFLAGS= $(CCOPTFLAG) -Dsigned= $($(MACH)_CCFLAGS)
# Define compilation macros.
#
COMPILE.c= $(CC) $(CFLAGS) $(CPPFLAGS) -c
COMPILE.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) -c
COMPILE.s= $(AS) $(ASFLAGS) $(AS_CPPFLAGS)
LINK.c= $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINK.cc= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS)
LINT.c= $(LINT) $(LINTFLAGS) $(CPPFLAGS)
# Define native compilation macros
#
sparc_NATIVECC= /opt/SUNWspro/bin/cc
i386_NATIVECC= /opt/SUNWspro/bin/cc
NATIVECC= $($(MACH)_NATIVECC)
# Pass -Y flag to cpp (method of which is release-dependent)
CCYFLAG= -Y I,
# Rules (normally from make.rules) and macros which are used for post
# processing files. Normally, these do stripping of the comment section
# automatically.
# RELEASE_CM: Should be editted to reflect the release.
# POST_PROCESS_O: Post-processing for `.o' files.
# POST_PROCESS_A: Post-processing for `.a' files (currently null).
# POST_PROCESS_SO: Post-processing for `.so' files.
# POST_PROCESS: Post-processing for executable files (no suffix).
# Note that these macros are not completely generalized as they are to be
# used with the file name to be processed following.
#
# It is left as an exercise to Release Engineering to embellish the generation
# of the release comment string.
#
# If this is a standard development build:
# compress the comment section (mcs -c)
# add the standard comment (mcs -a $(RELEASE_CM))
# add the development specific comment (mcs -a $(DEV_CM))
#
# If this is an installation build:
# delete the comment section (mcs -d)
# add the standard comment (mcs -a $(RELEASE_CM))
# add the development specific comment (mcs -a $(DEV_CM))
#
# If this is an release build:
# delete the comment section (mcs -d)
# add the standard comment (mcs -a $(RELEASE_CM))
#
# Sigh,... The declaration POUND_SIGN is always '#'. This is just needed
# to get around the make **bug** that '#' is always a comment delimiter,
# even when escaped or quoted.
#
# The following list of macros are used in the definition of RELEASE_CM
# which is used to label all binaries in the build:
#
# RELEASE Specific release of the build, eg: 5.2
# VERSION Version of the build (alpha, beta, Generic)
# PATCHID If this is a patch this value should contain
# the patchid value (eg: "Generic 100832-01"), otherwise
# it will be set to $(VERSION)
# RELEASE_DATE Date of the Release Build
# PATCH_DATE Date the patch was created, if this is blank it
# will default to the RELEASE_DATE
#
POUND_SIGN:sh= echo \\043
RELEASE= 5.5
VERSION= SunOS Development
PATCHID= $(VERSION)
RELEASE_DATE= April 1995
PATCH_DATE= $(RELEASE_DATE)
RELEASE_CM= "@($(POUND_SIGN))SunOS $(RELEASE) $(PATCHID) $(PATCH_DATE)"
DEV_CM= "@($(POUND_SIGN))SunOS Internal Development: `$(ECHO) $$LOGNAME` `date +%D` `$(ECHO) [\`basename $$CODEMGR_WS\`]`"
#
# SMALL_DEV_CM is used by ufsbootblk, because DEV_CM is too long.
# If you make this much longer, you may break the bootblock.
#
SMALL_DEV_CM= "`date +%D` `$(ECHO) [\`basename $$CODEMGR_WS\`]`"
PROCESS_COMMENT= @?${MCS} -c -a $(RELEASE_CM) -a $(DEV_CM)
$(STRIP_COMMENTS)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM) -a $(DEV_CM)
$(RELEASE_BUILD)PROCESS_COMMENT= @?${MCS} -d -a $(RELEASE_CM)
POST_PROCESS_O= $(PROCESS_COMMENT) $@
POST_PROCESS_A=
POST_PROCESS_SO= $(PROCESS_COMMENT) $@
POST_PROCESS= $(PROCESS_COMMENT) $@
# Default build rules which perform comment section post-processing.
#
.c:
$(LINK.c) -o $@ $< $(LDLIBS)
$(POST_PROCESS)
.c.o:
$(COMPILE.c) $(OUTPUT_OPTION) $<
$(POST_PROCESS_O)
.c.a:
$(COMPILE.c) -o $% $<
$(PROCESS_COMMENT) $%
$(AR) $(ARFLAGS) $@ $%
$(RM) $%
.s.o:
$(COMPILE.s) -o $@ $<
$(POST_PROCESS_O)
.s.a:
$(COMPILE.s) -o $% $<
$(PROCESS_COMMENT) $%
$(AR) $(ARFLAGS) $@ $%
$(RM) $%
.cc:
$(LINK.cc) -o $@ $< $(LDLIBS)
$(POST_PROCESS)
.cc.o:
$(COMPILE.cc) $(OUTPUT_OPTION) $<
$(POST_PROCESS_O)
.cc.a:
$(COMPILE.cc) -o $% $<
$(AR) $(ARFLAGS) $@ $%
$(PROCESS_COMMENT) $%
$(RM) $%
.y:
$(YACC.y) $<
$(LINK.c) -o $@ y.tab.c $(LDLIBS)
$(POST_PROCESS)
$(RM) y.tab.c
.y.o:
$(YACC.y) $<
$(COMPILE.c) -o $@ y.tab.c
$(POST_PROCESS_O)
$(RM) y.tab.c
.l:
$(RM) $*.c
$(LEX.l) $< > $*.c
$(LINK.c) -o $@ $*.c -ll $(LDLIBS)
$(POST_PROCESS)
$(RM) $*.c
.l.o:
$(RM) $*.c
$(LEX.l) $< > $*.c
$(COMPILE.c) -o $@ $*.c
$(POST_PROCESS_O)
$(RM) $*.c
#
# Rules to create message catalogue files from
# .c, .y and .l files
#
.c.po:
$(COMPILE.cpp) $< > $<.i
$(BUILD.po)
.y.po:
yacc -d $<
$(COMPILE.cpp) y.tab.c > $<.i
$(BUILD.po)
$(RM) y.tab.c
.l.po:
lex $<
$(COMPILE.cpp) lex.yy.c > $<.i
$(BUILD.po)
$(RM) lex.yy.c
#
# Rules to perform stylistic checks
#
.SUFFIXES: $(SUFFIXES) .x .check
.h.check:
$(DOT_H_CHECK)
.x.check:
$(DOT_X_CHECK)