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