xref: /titanic_50/usr/src/cmd/sgs/Makefile.com (revision 1c42de6d020629af774dd9e9fc81be3f3ed9398e)
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 2006 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
41ROOTCCSBIN64 =	$(ROOTCCSBIN)/$(MACH64)
42ROOTCCSBINPROG64 = \
43		$(PROG:%=$(ROOTCCSBIN64)/%)
44
45# Establish any global flags.
46
47# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT()
48# checking.  This is automatically enabled for DEBUG builds, not for non-debug
49# builds.  Unset the global C99_DISABLE flag to insure we uncover all compiler
50# warnings/errors.
51DEBUG =
52$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG
53
54C99_DISABLE =	$(C99_ENABLE)
55
56CFLAGS +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
57CFLAGS64 +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
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)
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# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN.  We don't need
101# this definition as the sgs utilities obtain their domain via sgsmsg(1l).
102
103DTEXTDOM =
104
105# Define any generic sgsmsg(1l) flags.  The default message generation system
106# is to use gettext(3i), add the -C flag to switch to catgets(3c).
107
108SGSMSG =	$(SGSTOOLS)/$(MACH)/sgsmsg
109CHKMSG =	$(SGSTOOLS)/chkmsg.sh
110
111SGSMSGVFLAG =
112SGSMSGFLAGS =	$(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
113CHKMSGFLAGS =	$(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)
114
115# Native targets should use the minimum of ld(1) flags to allow building on
116# previous releases.  We use mapfiles to scope, but don't bother versioning.
117
118native :=	DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
119
120USE_PROTO =	-Yl,$(SGSPROTO)
121
122#
123# lint-related stuff
124#
125
126DASHES =	"------------------------------------------------------------"
127
128LIBNAME32 =	$(LIBNAME:%=%32)
129LIBNAME64 =	$(LIBNAME:%=%64)
130LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
131
132SGSLINTOUT =	lint.out
133LINTOUT1 =	lint.out.1
134LINTOUT32 =	lint.out.32
135LINTOUT64 =	lint.out.64
136LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
137
138LINTLIBSRC =	$(LINTLIB:%.ln=%)
139LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
140LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
141LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
142
143LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
144LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
145		    $(VAR_LINTFLAGS64) \
146
147#
148# These libraries have two resulting lint libraries.  If a dependency is
149# declared using these variables, the substitution for the 32/64 versions at
150# lint time happens automatically (see Makefile.targ).
151#
152LD_LIB =	-lld
153LD_LIB32 =	-lld32
154LD_LIB64 =	-lld64
155
156LDDBG_LIB =	-llddbg
157LDDBG_LIB32 =	-llddbg32
158LDDBG_LIB64 =	-llddbg64
159
160CONV_LIB =	-lconv
161CONV_LIB32 =	-lconv32
162CONV_LIB64 =	-lconv64
163