xref: /illumos-gate/usr/src/cmd/sgs/Makefile.com (revision 257873cfc1dd3337766407f80397db60a56f2f5a)
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 2008 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
123LIBNAME32 =	$(LIBNAME:%=%32)
124LIBNAME64 =	$(LIBNAME:%=%64)
125LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
126
127SGSLINTOUT =	lint.out
128LINTOUT1 =	lint.out.1
129LINTOUT32 =	lint.out.32
130LINTOUT64 =	lint.out.64
131LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
132
133LINTLIBSRC =	$(LINTLIB:%.ln=%)
134LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
135LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
136LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
137
138LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
139LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
140		    $(VAR_LINTFLAGS64) \
141
142#
143# These libraries have two resulting lint libraries.  If a dependency is
144# declared using these variables, the substitution for the 32/64 versions at
145# lint time happens automatically (see Makefile.targ).
146#
147LD_LIB =	-lld
148LD_LIB32 =	-lld32
149LD_LIB64 =	-lld64
150
151LDDBG_LIB =	-llddbg
152LDDBG_LIB32 =	-llddbg32
153LDDBG_LIB64 =	-llddbg64
154
155CONV_LIB =	-lconv
156CONV_LIB32 =	-lconv32
157CONV_LIB64 =	-lconv64
158