xref: /titanic_44/usr/src/cmd/sgs/Makefile.com (revision 4557a2a1868181b517f5dfe61ba6eeba58edf4c0)
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
105CHKMSG =	$(SGSTOOLS)/chkmsg.sh
106
107SGSMSGVFLAG =
108SGSMSGFLAGS =	$(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
109CHKMSGFLAGS =	$(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)
110
111# Native targets should use the minimum of ld(1) flags to allow building on
112# previous releases.  We use mapfiles to scope, but don't bother versioning.
113
114native :=	DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
115
116USE_PROTO =	-Yl,$(SGSPROTO)
117
118#
119# lint-related stuff
120#
121
122DASHES =	"------------------------------------------------------------"
123
124LIBNAME32 =	$(LIBNAME:%=%32)
125LIBNAME64 =	$(LIBNAME:%=%64)
126LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
127
128SGSLINTOUT =	lint.out
129LINTOUT1 =	lint.out.1
130LINTOUT32 =	lint.out.32
131LINTOUT64 =	lint.out.64
132LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
133
134LINTLIBSRC =	$(LINTLIB:%.ln=%)
135LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
136LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
137LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
138
139LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
140LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
141		    $(VAR_LINTFLAGS64) \
142
143#
144# These libraries have two resulting lint libraries.  If a dependency is
145# declared using these variables, the substitution for the 32/64 versions at
146# lint time happens automatically (see Makefile.targ).
147#
148LD_LIB =	-lld
149LD_LIB32 =	-lld32
150LD_LIB64 =	-lld64
151
152LDDBG_LIB =	-llddbg
153LDDBG_LIB32 =	-llddbg32
154LDDBG_LIB64 =	-llddbg64
155
156CONV_LIB =	-lconv
157CONV_LIB32 =	-lconv32
158CONV_LIB64 =	-lconv64
159