Makefile.targ revision 1dd08564e4a3aafe66b00aee6f222b0885346fe8
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# CDDL HEADER START
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# The contents of this file are subject to the terms of the
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# Common Development and Distribution License (the "License").
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# You may not use this file except in compliance with the License.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# See the License for the specific language governing permissions
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# and limitations under the License.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# When distributing Covered Code, include this CDDL HEADER in each
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# If applicable, add the following below this CDDL HEADER, with the
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# fields enclosed by brackets "[]" replaced with your own identifying
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# information: Portions Copyright [yyyy] [name of copyright owner]
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# CDDL HEADER END
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# Use is subject to license terms.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# ident "%Z%%M% %I% %E% SMI"
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# Standard install rules
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# The VAR_SGSBIN and VAR_SGSBIN64 install rules included here are applicable
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# to Solaris 10 and earlier releases. For post Solaris 10 releases, the
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# standard ROOTBIN and ROOTBIN64 rules defined in ../Makefile.cmd are used.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# The new rules here are included to allow for easier backporting. Making
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# the appropriate updates in ./Makefile.var, will allow the SGS components
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# to be installed in /usr/ccs/bin rather than the current /usr/bin.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos$(VAR_SGSBIN)/%: %
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos$(VAR_SGSBIN64)/%: %
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos################################################################################
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# Linting the Linker Libraries
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# Several of the linker's libraries are, in whole or in part, built in two
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# passes, once as Elf32 and once as Elf64 (i.e. with -D_ELF64 defined). Lint
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# needs to be able to do both passes, but combining the two is problematic for
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# the 2nd pass of lint, as it sees many interfaces as being defined both ways
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# and considers them to be incompatible. The targets defined here allow for
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# both passes to live independently. This means that both the lint.out, and
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# the lint library itself get generated separately, to different output files.
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# The lint.out's get combined into a single lint.out report, and the lint
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# libraries get generated with a 32/64 suffix. The dependents on these lint
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# libraries, then, choose which version they need to use. Substitutions can
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# be made automatically if the macro's defined in ./Makefile.com are used to
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# specify the dependency, for those libs that need them.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# Don't use the /*LINTLIBRARY*/ directive in linker libraries, this disables
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# some important checks, including the ability to test format strings from the
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# Don't use the `-x' option to lint when linting linker libraries. This masks
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# all the dead wood in our own header files. Instead, there has been added to
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# the relevant common directories a file called `lintsup.c' which is used to
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# mask out the headers that we aren't interested in. This method is used for
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# libraries, like libld, which have their own header files, but is irrelevant
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# to libraries like libldstab which exports no interface of it's own.
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# The `lintsup.c' file can also be used, in some cases, to mask out other
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# issues that lint won't otherwise shut up about.
dd291c383b4490ed77e47d65b4c52595d915f802Chad Kienle# Other Lint Options
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# `-m' has been added to the LINTFLAGS. Warnings about globals that could be
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# static are irrelevant as we use mapfiles to scope down unnecessary globals.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# `-u' is used in the LINTFLAGS for libraries, otherwise lint tends to be very
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# `-x' is avoided for libraries, but is used for executables because all we
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# care about is that what we use is defined, not about declarations in public
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# headers that we don't use.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# Relevant variables:
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# SRCS= ../common/llib-l<libname>
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# LINTSRCS= <source files>
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# LDLIBS= ... [$(LDDBG_LIB) $(LD_LIB)]
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# LINTFLAGS= ...
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# LINTFLAGS64= ...
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# CLEANFILES += ... $(LINTOUTS)
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# CLOBBERFILES += ... $(LINTLIBS)
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# Relevant targets:
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# # this file for SGS lint targets.
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# lint: <choose the desired functionality> $(SGSLINTOUT)
47196c962e3caf7cdf7ea5d00ccdefc9f208bdceLaszlo Hordos# $(LINTLIB32),
# $(SGSLINTOUT) Create a `lint.out' file as the concatination
$(LINT.c) -o $(LIBNAME32) $(SRCS)
$(LINT.c) -D_ELF64 -o $(LIBNAME64) $(SRCS)
$(LINT.c) $(LINTSRCS) $(LINTSRCS32) $(LDLIBS) > $(LINTOUT32) 2>&1
$(LINT.c) -D_ELF64 $(LINTSRCS) $(LINTSRCS64) \
# LINT_HDR - Use sgs/tools/lint_hdr.pl to generate lint output headers
LINT_HDR= perl $(SGSTOOLS)/lint_hdr.pl
if [ $(DYNLIB) = "libld.so.2" ] ; then \
$(LINT_HDR) libld.so.3 64 | $(LINT_TEE); \
$(INS.file) ../common/$(LINTLIBSRC)
$(VAR_POUND_1) $(INS.liblink)
$(VAR_POUND_1) $(INS.liblink64)
$(VAR_POUND_1) $(INS.liblinkccc)
$(VAR_POUND_1) $(INS.liblinkccc64)