xref: /titanic_41/usr/src/cmd/sgs/Makefile.com (revision cd3e933325e68e23516a196a8fea7f49b1e497c3)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27.KEEP_STATE:
28.KEEP_STATE_FILE: .make.state.$(MACH)
29
30
31include		$(SRC)/cmd/sgs/Makefile.var
32
33SRCBASE =	../../../..
34
35i386_ARCH =	intel
36sparc_ARCH =	sparc
37
38ARCH =		$($(MACH)_ARCH)
39
40# Establish any global flags.
41
42# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT()
43# checking.  This is automatically enabled for DEBUG builds, not for non-debug
44# builds.  Unset the global C99_DISABLE flag to insure we uncover all compiler
45# warnings/errors.
46DEBUG =
47$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG
48
49C99_DISABLE =	$(C99_ENABLE)
50
51CFLAGS +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
52CFLAGS64 +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
53
54#
55# Location of the shared elfcap code
56#
57ELFCAP=		$(SRC)/common/elfcap
58
59# Reassign CPPFLAGS so that local search paths are used before any parent
60# $ROOT paths.
61CPPFLAGS =	-I. -I../common -I../../include -I../../include/$(MACH) \
62		$(VAR_CPPFLAGS) $(CPPFLAGS.master) -I$(ELFCAP)
63
64# PICS64 is unique to our environment
65$(PICS64) :=	sparc_CFLAGS += -xregs=no%appl -K pic
66$(PICS64) :=	sparcv9_CFLAGS += -xregs=no%appl -K pic
67$(PICS64) :=	CPPFLAGS += -DPIC -D_REENTRANT
68
69LDFLAGS +=	$(ZIGNORE)
70DYNFLAGS +=	$(ZIGNORE)
71
72# Establish the local tools, proto and package area.
73
74SGSHOME =	$(SRC)/cmd/sgs
75SGSPROTO =	$(SGSHOME)/proto/$(MACH)
76SGSTOOLS =	$(SGSHOME)/tools
77SGSMSGID =	$(SGSHOME)/messages
78SGSMSGDIR =	$(SGSHOME)/messages/$(MACH)
79SGSONLD =	$(ROOT)/opt/SUNWonld
80SGSRPATH =	/usr/lib
81SGSRPATH64 =	$(SGSRPATH)/$(MACH64)
82
83#
84# Macros to be used to include link against libconv and include vernote.o
85#
86VERSREF =	-ulink_ver_string
87
88LDLIBDIR =	-L$(SGSHOME)/libld/$(MACH)
89LDLIBDIR64 =	-L$(SGSHOME)/libld/$(MACH64)
90
91CONVLIBDIR =	-L$(SGSHOME)/libconv/$(MACH)
92CONVLIBDIR64 =	-L$(SGSHOME)/libconv/$(MACH64)
93
94ELFLIBDIR =	-L$(SGSHOME)/libelf/$(MACH)
95ELFLIBDIR64 =	-L$(SGSHOME)/libelf/$(MACH64)
96
97LDDBGLIBDIR =	-L$(SGSHOME)/liblddbg/$(MACH)
98LDDBGLIBDIR64 =	-L$(SGSHOME)/liblddbg/$(MACH64)
99
100
101# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN.  We don't need
102# this definition as the sgs utilities obtain their domain via sgsmsg(1l).
103
104DTEXTDOM =
105
106# Define any generic sgsmsg(1l) flags.  The default message generation system
107# is to use gettext(3i), add the -C flag to switch to catgets(3c).
108
109SGSMSG =		$(SGSTOOLS)/$(MACH)/sgsmsg
110SGSMSG_PIGLATIN_NL =	perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl
111CHKMSG =		$(SGSTOOLS)/chkmsg.sh
112
113SGSMSGVFLAG =
114SGSMSGFLAGS =	$(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
115CHKMSGFLAGS =	$(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)
116
117# Native targets should use the minimum of ld(1) flags to allow building on
118# previous releases.  We use mapfiles to scope, but don't bother versioning.
119
120native :=	DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
121
122# Comment out the following two lines to have the sgs built from the system
123# link-editor, rather than the local proto link-editor.
124CC_USE_PROTO =	-Yl,$(SGSPROTO)
125LD_USE_PROTO =	$(SGSPROTO)/
126
127#
128# lint-related stuff
129#
130LIBNAME32 =	$(LIBNAME:%=%32)
131LIBNAME64 =	$(LIBNAME:%=%64)
132LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
133
134SGSLINTOUT =	lint.out
135LINTOUT1 =	lint.out.1
136LINTOUT32 =	lint.out.32
137LINTOUT64 =	lint.out.64
138LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
139
140LINTLIBSRC =	$(LINTLIB:%.ln=%)
141LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
142LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
143LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
144
145LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
146LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
147		    $(VAR_LINTFLAGS64)
148
149#
150# When building a lint library, no other lint libraries are verified as
151# dependencies, nor is the stardard C lint library processed.  All dependency
152# verification is carried out through linting the sources themselves.
153#
154$(LINTLIB) :=	LINTFLAGS += -n
155$(LINTLIB) :=	LINTFLAGS64 += -n
156
157$(LINTLIB32) :=	LINTFLAGS += -n
158$(LINTLIB32) :=	LINTFLAGS64 += -n
159$(LINTLIB64) :=	LINTFLAGS += -n
160$(LINTLIB64) :=	LINTFLAGS64 += -n
161
162#
163# These libraries have two resulting lint libraries.  If a dependency is
164# declared using these variables, the substitution for the 32/64 versions at
165# lint time happens automatically (see Makefile.targ).
166#
167LD_LIB =	-lld
168LD_LIB32 =	-lld32
169LD_LIB64 =	-lld64
170
171LDDBG_LIB =	-llddbg
172LDDBG_LIB32 =	-llddbg32
173LDDBG_LIB64 =	-llddbg64
174
175CONV_LIB =	-lconv
176CONV_LIB32 =	-lconv32
177CONV_LIB64 =	-lconv64
178