annotate usr/src/cmd/sgs/Makefile.targ @ 12939:a27c46eb192b

6972234 sgs demo's could use some cleanup
author Rod Evans <Rod.Evans@Sun.COM>
date Tue, 27 Jul 2010 22:49:34 -0700
parents 59445bec7ef4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
1 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
2 # CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
3 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
4 # The contents of this file are subject to the terms of the
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
5 # Common Development and Distribution License (the "License").
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
6 # You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
7 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
9 # or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
10 # See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
11 # and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
12 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
13 # When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
15 # If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
16 # fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
17 # information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
18 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
19 # CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
20 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
21
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
22 #
12939
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
23 # Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
24 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
25
4538
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
26 # Standard install rules
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
27 # The VAR_SGSBIN and VAR_SGSBIN64 install rules included here are applicable
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
28 # to Solaris 10 and earlier releases. For post Solaris 10 releases, the
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
29 # standard ROOTBIN and ROOTBIN64 rules defined in ../Makefile.cmd are used.
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
30 # The new rules here are included to allow for easier backporting. Making
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
31 # the appropriate updates in ./Makefile.var, will allow the SGS components
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
32 # to be installed in /usr/ccs/bin rather than the current /usr/bin.
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
33 #
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
34 $(VAR_SGSBIN)/%: %
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
35 $(INS.file)
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
36
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
37 $(VAR_SGSBIN64)/%: %
844098db2e81 PSARC 2005/420 Movement of /usr/ccs/bin utilities to /usr/bin
damico
parents: 1618
diff changeset
38 $(INS.file)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
39
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
40 ################################################################################
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
41 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
42 # Linting the Linker Libraries
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
43 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
44 # Several of the linker's libraries are, in whole or in part, built in two
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
45 # passes, once as Elf32 and once as Elf64 (i.e. with -D_ELF64 defined). Lint
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
46 # needs to be able to do both passes, but combining the two is problematic for
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
47 # the 2nd pass of lint, as it sees many interfaces as being defined both ways
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
48 # and considers them to be incompatible. The targets defined here allow for
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
49 # both passes to live independently. This means that both the lint.out, and
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
50 # the lint library itself get generated separately, to different output files.
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
51 # The lint.out's get combined into a single lint.out report, and the lint
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
52 # libraries get generated with a 32/64 suffix. The dependents on these lint
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
53 # libraries, then, choose which version they need to use. Substitutions can
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
54 # be made automatically if the macro's defined in ./Makefile.com are used to
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
55 # specify the dependency, for those libs that need them.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
56 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
57 # Don't
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
58 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
59 # Don't use the /*LINTLIBRARY*/ directive in linker libraries, this disables
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
60 # some important checks, including the ability to test format strings from the
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
61 # msg.h files.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
62 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
63 # Don't use the `-x' option to lint when linting linker libraries. This masks
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
64 # all the dead wood in our own header files. Instead, there has been added to
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
65 # the relevant common directories a file called `lintsup.c' which is used to
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
66 # mask out the headers that we aren't interested in. This method is used for
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
67 # libraries, like libld, which have their own header files, but is irrelevant
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
68 # to libraries like libldstab which exports no interface of it's own.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
69 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
70 # The `lintsup.c' file can also be used, in some cases, to mask out other
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
71 # issues that lint won't otherwise shut up about.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
72 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
73 # Other Lint Options
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
74 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
75 # `-m' has been added to the LINTFLAGS. Warnings about globals that could be
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
76 # static are irrelevant as we use mapfiles to scope down unnecessary globals.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
77 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
78 # `-u' is used in the LINTFLAGS for libraries, otherwise lint tends to be very
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
79 # noisy.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
80 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
81 # `-x' is avoided for libraries, but is used for executables because all we
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
82 # care about is that what we use is defined, not about declarations in public
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
83 # headers that we don't use.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
84 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
85 # Relevant variables:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
86 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
87 # */Makefile.com
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
88 # SRCS= ../common/llib-l<libname>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
89 # LINTSRCS= <source files>
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
90 # LDLIBS= ... [$(LDDBG_LIB) $(LD_LIB)]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
91 # LINTFLAGS= ...
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
92 # LINTFLAGS64= ...
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
93 # CLEANFILES += ... $(LINTOUTS)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
94 # CLOBBERFILES += ... $(LINTLIBS)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
95 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
96 # Relevant targets:
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
97 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
98 # */Makefile.targ
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
99 # # this file for SGS lint targets.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
100 # include $(SRC)/cmd/sgs/Makefile.targ
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
101 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
102 # lint: <choose the desired functionality> $(SGSLINTOUT)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
103 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
104 # $(LINTLIB32),
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
105 # $(LINTLIB64) Create an Elf32 or Elf64 lint library from
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
106 # a proto file indicated by the $(SRCS) variable.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
107 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
108 # $(LINTOUT32),
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
109 # $(LINTOUT64) Run lint on the sources indicated by the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
110 # $(LINTSRCS) variable with respect to Elf32
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
111 # or Elf64. Dependencies are gathered from
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
112 # the $(LDLIBS) variable.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
113 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
114 # $(SGSLINTOUT) Create a `lint.out' file as the concatination
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
115 # of the lint output from the previous targets.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
116 # This should be specified *last* in the list.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
117 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
118 ################################################################################
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
119
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
120 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
121 # Override the OS's $(LINTOUT) target to avoid confusion.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
122 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
123 LINTOUT = $(LINTOUT1)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
124
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
125 #
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
126 # If LD_LIB, LDDBG_LIB, or CONV_LIB is added to LDLIBS, then the right lint
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
127 # library should be picked up automatically.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
128 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
129 $(LINTOUT32) := LD_LIB=$(LD_LIB32)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
130 $(LINTOUT32) := LDDBG_LIB=$(LDDBG_LIB32)
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
131 $(LINTOUT32) := CONV_LIB=$(CONV_LIB32)
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
132
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
133 $(LINTOUT64) := LD_LIB=$(LD_LIB64)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
134 $(LINTOUT64) := LDDBG_LIB=$(LDDBG_LIB64)
1618
8c9a4f31d225 6316708 LD_DEBUG should provide a means of identifying/isolating individual
rie
parents: 0
diff changeset
135 $(LINTOUT64) := CONV_LIB=$(CONV_LIB64)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
136
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
137 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
138 # Force $(LINTLIB) in order to help the $(SGSLINTOUT)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
139 # target produce the same output on successive runs.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
140 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
141 $(LINTLIB): FRC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
142
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
143 $(LINTLIB32): $(SRCS)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
144 $(LINT.c) -o $(LIBNAME32) $(SRCS)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
145
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
146 $(LINTLIB64): $(SRCS)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
147 $(LINT.c) -D_ELF64 -o $(LIBNAME64) $(SRCS)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
148
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
149 $(LINTOUT32): $(LINTSRCS) $(LINTSRCS32)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
150 $(LINT.c) $(LINTSRCS) $(LINTSRCS32) $(LDLIBS) > $(LINTOUT32) 2>&1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
151
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
152 $(LINTOUT64): $(LINTSRCS) $(LINTSRCS64)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
153 $(LINT.c) -D_ELF64 $(LINTSRCS) $(LINTSRCS64) \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
154 $(LDLIBS) > $(LINTOUT64) 2>&1
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
155
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
156 #
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
157 # A couple of macros used in the SGSLINTOUT rule below
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
158 #
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
159 # LINT_HDR - Use sgs/tools/lint_hdr.pl to generate lint output headers
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
160 # LINT_TEE - Use tee to write output to stdout and also capture it
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
161 # in the SGSLINT output file.
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
162 #
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
163 # An additional complexity: We produce headers for all the lint
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
164 # output so that we can tell what came from where when we look
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
165 # at the resulting file. We also cat these headers to stdout so that
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
166 # the user of make will see them. However, we don't want the headers
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
167 # to go to stdout if there is only one of LINTOUT32 and LINTOUT64. To
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
168 # the interactive user, the headers are only interesting as a way to
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
169 # separate the two ELF classes. We only bother with this for the
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
170 # non-DYNLIB and non-RTLD case, because at the current time, both of these
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
171 # cases always have both 32 and 64-bit ELFCLASS support.
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
172 #
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
173 LINT_HDR= perl $(SGSTOOLS)/lint_hdr.pl
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
174 LINT_TEE= tee -a $(SGSLINTOUT)
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
175
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
176 $(SGSLINTOUT): FRC
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
177 @ rm -f $(SGSLINTOUT)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
178 @ if [ -r $(LINTOUT1) ]; then \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
179 $(LINT_HDR) $(LINTLIB) | $(LINT_TEE); \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
180 cat $(LINTOUT1) | $(LINT_TEE); \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
181 fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
182 @ if [ -r $(LINTOUT32) ]; then \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
183 if [ -n "$(DYNLIB)" ] ; then \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
184 $(LINT_HDR) $(DYNLIB) 32 | $(LINT_TEE); \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
185 elif [ -n "$(RTLD)" ] ; then \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
186 $(LINT_HDR) $(RTLD) 32 | $(LINT_TEE); \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
187 else \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
188 if [ -r $(LINTOUT64) ]; then \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
189 $(LINT_HDR) $(PROG) 32 | $(LINT_TEE); \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
190 else \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
191 $(LINT_HDR) $(PROG) 32 >> $(SGSLINTOUT); \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
192 fi; \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
193 fi; \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
194 cat $(LINTOUT32) | $(LINT_TEE); \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
195 fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
196 @ if [ -r $(LINTOUT64) ]; then \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
197 if [ -n "$(DYNLIB)" ] ; then \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
198 if [ $(DYNLIB) = "libld.so.2" ] ; then \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
199 $(LINT_HDR) libld.so.3 64 | $(LINT_TEE); \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
200 else \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
201 $(LINT_HDR) $(DYNLIB) 64 | $(LINT_TEE); \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
202 fi; \
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
203 elif [ -n "$(RTLD)" ] ; then \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
204 $(LINT_HDR) $(RTLD) 64 | $(LINT_TEE); \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
205 else \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
206 if [ -r $(LINTOUT32) ]; then \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
207 $(LINT_HDR) $(PROG) 64 | $(LINT_TEE); \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
208 else \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
209 $(LINT_HDR) $(PROG) 64 >> $(SGSLINTOUT); \
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
210 fi; \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
211 fi; \
6951
59445bec7ef4 6716350 usr/src/cmd/sgs should be linted by nightly builds
ab196087
parents: 4538
diff changeset
212 cat $(LINTOUT64) | $(LINT_TEE); \
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
213 fi
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
214 @ rm -f $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
215
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
216 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
217 # For those that install the lint library source file.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
218 #
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
219 $(ROOTLIBDIR)/$(LINTLIBSRC): ../common/$(LINTLIBSRC)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
220 $(INS.file) ../common/$(LINTLIBSRC)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
221
12939
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
222 $(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS)
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
223 $(INS.liblink)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
224
12939
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
225 $(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
226 $(INS.liblink64)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
227
12939
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
228 $(ROOTFS_LIBDIR)/$(LIBLINKSCCC): $(ROOTFS_LIBDIR)/$(LIBLINKSCCC)$(VERS)
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
229 $(INS.liblinkccc)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
230
12939
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
231 $(ROOTFS_LIBDIR64)/$(LIBLINKSCCC): $(ROOTFS_LIBDIR64)/$(LIBLINKSCCC)$(VERS)
a27c46eb192b 6972234 sgs demo's could use some cleanup
Rod Evans <Rod.Evans@Sun.COM>
parents: 6951
diff changeset
232 $(INS.liblinkccc64)
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
233
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
234 FRC: