xref: /titanic_50/usr/src/cmd/sgs/Makefile.com (revision c7158ae983f5a04c4a998f468ecefba6d23ba721)
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# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25# ident	"%Z%%M%	%I%	%E% SMI"
26#
27
28.KEEP_STATE:
29.KEEP_STATE_FILE: .make.state.$(MACH)
30
31
32include		$(SRC)/cmd/sgs/Makefile.var
33
34SRCBASE =	../../../..
35
36i386_ARCH =	$(VAR_I386_ARCH)
37sparc_ARCH =	sparc
38
39ARCH =		$($(MACH)_ARCH)
40
41# Establish any global flags.
42
43# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT()
44# checking.  This is automatically enabled for DEBUG builds, not for non-debug
45# builds.  Unset the global C99_DISABLE flag to insure we uncover all compiler
46# warnings/errors.
47DEBUG =
48$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG
49
50C99_DISABLE =	$(C99_ENABLE)
51
52CFLAGS +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
53CFLAGS64 +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
54
55# Reassign CPPFLAGS so that local search paths are used before any parent
56# $ROOT paths.
57CPPFLAGS =	-I. -I../common -I../../include -I../../include/$(MACH) \
58		$(VAR_CPPFLAGS) $(CPPFLAGS.master)
59
60# PICS64 is unique to our environment
61$(PICS64) :=	sparc_CFLAGS += -xregs=no%appl -K pic
62$(PICS64) :=	sparcv9_CFLAGS += -xregs=no%appl -K pic
63$(PICS64) :=	CPPFLAGS += -DPIC -D_REENTRANT
64
65LDFLAGS +=	$(ZIGNORE)
66DYNFLAGS +=	$(ZIGNORE)
67
68# Establish the local tools, proto and package area.
69
70SGSHOME =	$(SRC)/cmd/sgs
71SGSPROTO =	$(SGSHOME)/proto/$(MACH)
72SGSTOOLS =	$(SGSHOME)/tools
73SGSMSGID =	$(SGSHOME)/messages
74SGSMSGDIR =	$(SGSHOME)/messages/$(MACH)
75SGSONLD =	$(ROOT)/opt/SUNWonld
76SGSRPATH =	/usr/lib
77SGSRPATH64 =	$(SGSRPATH)/$(MACH64)
78
79#
80# Macros to be used to include link against libconv and include vernote.o
81#
82VERSREF =	-ulink_ver_string
83
84LDLIBDIR =	-L$(SGSHOME)/libld/$(MACH)
85LDLIBDIR64 =	-L$(SGSHOME)/libld/$(MACH64)
86
87CONVLIBDIR =	-L$(SGSHOME)/libconv/$(MACH)
88CONVLIBDIR64 =	-L$(SGSHOME)/libconv/$(MACH64)
89
90ELFLIBDIR =	-L$(SGSHOME)/libelf/$(MACH)
91ELFLIBDIR64 =	-L$(SGSHOME)/libelf/$(MACH64)
92
93LDDBGLIBDIR =	-L$(SGSHOME)/liblddbg/$(MACH)
94LDDBGLIBDIR64 =	-L$(SGSHOME)/liblddbg/$(MACH64)
95
96# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN.  We don't need
97# this definition as the sgs utilities obtain their domain via sgsmsg(1l).
98
99DTEXTDOM =
100
101# Define any generic sgsmsg(1l) flags.  The default message generation system
102# is to use gettext(3i), add the -C flag to switch to catgets(3c).
103
104SGSMSG =		$(SGSTOOLS)/$(MACH)/sgsmsg
105SGSMSG_PIGLATIN_NL =	perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl
106CHKMSG =		$(SGSTOOLS)/chkmsg.sh
107
108SGSMSGVFLAG =
109SGSMSGFLAGS =	$(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
110CHKMSGFLAGS =	$(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)
111
112# Native targets should use the minimum of ld(1) flags to allow building on
113# previous releases.  We use mapfiles to scope, but don't bother versioning.
114
115native :=	DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
116
117USE_PROTO =	-Yl,$(SGSPROTO)
118
119#
120# lint-related stuff
121#
122
123DASHES =	"------------------------------------------------------------"
124
125LIBNAME32 =	$(LIBNAME:%=%32)
126LIBNAME64 =	$(LIBNAME:%=%64)
127LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
128
129SGSLINTOUT =	lint.out
130LINTOUT1 =	lint.out.1
131LINTOUT32 =	lint.out.32
132LINTOUT64 =	lint.out.64
133LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
134
135LINTLIBSRC =	$(LINTLIB:%.ln=%)
136LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
137LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
138LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
139
140LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
141LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
142		    $(VAR_LINTFLAGS64) \
143
144#
145# These libraries have two resulting lint libraries.  If a dependency is
146# declared using these variables, the substitution for the 32/64 versions at
147# lint time happens automatically (see Makefile.targ).
148#
149LD_LIB =	-lld
150LD_LIB32 =	-lld32
151LD_LIB64 =	-lld64
152
153LDDBG_LIB =	-llddbg
154LDDBG_LIB32 =	-llddbg32
155LDDBG_LIB64 =	-llddbg64
156
157CONV_LIB =	-lconv
158CONV_LIB32 =	-lconv32
159CONV_LIB64 =	-lconv64
160