xref: /titanic_51/usr/src/cmd/sgs/Makefile.com (revision c10c16dec587a0662068f6e2991c29ed3a9db943)
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#
23# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
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#
54# Location of the shared elfcap code
55#
56ELFCAP=		$(SRC)/common/elfcap
57
58# Reassign CPPFLAGS so that local search paths are used before any parent
59# $ROOT paths.
60CPPFLAGS =	-I. -I../common -I../../include -I../../include/$(MACH) \
61		$(CPPFLAGS.master) -I$(ELFCAP)
62
63# PICS64 is unique to our environment
64$(PICS64) :=	sparc_CFLAGS += -xregs=no%appl -K pic
65$(PICS64) :=	sparcv9_CFLAGS += -xregs=no%appl -K pic
66$(PICS64) :=	CPPFLAGS += -DPIC -D_REENTRANT
67
68LDFLAGS +=	$(ZIGNORE)
69DYNFLAGS +=	$(ZIGNORE)
70
71# Establish the local tools, proto and package area.
72
73SGSHOME =	$(SRC)/cmd/sgs
74SGSPROTO =	$(SGSHOME)/proto/$(MACH)
75SGSTOOLS =	$(SGSHOME)/tools
76SGSMSGID =	$(SGSHOME)/messages
77SGSMSGDIR =	$(SGSHOME)/messages/$(MACH)
78SGSONLD =	$(ROOT)/opt/SUNWonld
79SGSRPATH =	/usr/lib
80SGSRPATH64 =	$(SGSRPATH)/$(MACH64)
81
82#
83# Macros to be used to include link against libconv and include vernote.o
84#
85VERSREF =	-ulink_ver_string
86
87LDLIBDIR =	-L$(SGSHOME)/libld/$(MACH)
88LDLIBDIR64 =	-L$(SGSHOME)/libld/$(MACH64)
89
90CONVLIBDIR =	-L$(SGSHOME)/libconv/$(MACH)
91CONVLIBDIR64 =	-L$(SGSHOME)/libconv/$(MACH64)
92
93ELFLIBDIR =	-L$(SGSHOME)/libelf/$(MACH)
94ELFLIBDIR64 =	-L$(SGSHOME)/libelf/$(MACH64)
95
96LDDBGLIBDIR =	-L$(SGSHOME)/liblddbg/$(MACH)
97LDDBGLIBDIR64 =	-L$(SGSHOME)/liblddbg/$(MACH64)
98
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
109SGSMSG_PIGLATIN_NL =	perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl
110CHKMSG =		$(SGSTOOLS)/chkmsg.sh
111
112SGSMSGVFLAG =
113SGSMSGFLAGS =	$(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
114CHKMSGFLAGS =	$(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)
115
116# Native targets should use the minimum of ld(1) flags to allow building on
117# previous releases.  We use mapfiles to scope, but don't bother versioning.
118
119native :=	DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
120
121# Comment out the following two lines to have the sgs built from the system
122# link-editor, rather than the local proto link-editor.
123CC_USE_PROTO =	-Yl,$(SGSPROTO)
124LD_USE_PROTO =	$(SGSPROTO)/
125
126#
127# lint-related stuff
128#
129LIBNAME32 =	$(LIBNAME:%=%32)
130LIBNAME64 =	$(LIBNAME:%=%64)
131LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
132
133SGSLINTOUT =	lint.out
134LINTOUT1 =	lint.out.1
135LINTOUT32 =	lint.out.32
136LINTOUT64 =	lint.out.64
137LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
138
139LINTLIBSRC =	$(LINTLIB:%.ln=%)
140LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
141LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
142LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
143
144LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
145LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
146		    $(VAR_LINTFLAGS64)
147
148#
149# When building a lint library, no other lint libraries are verified as
150# dependencies, nor is the stardard C lint library processed.  All dependency
151# verification is carried out through linting the sources themselves.
152#
153$(LINTLIB) :=	LINTFLAGS += -n
154$(LINTLIB) :=	LINTFLAGS64 += -n
155
156$(LINTLIB32) :=	LINTFLAGS += -n
157$(LINTLIB32) :=	LINTFLAGS64 += -n
158$(LINTLIB64) :=	LINTFLAGS += -n
159$(LINTLIB64) :=	LINTFLAGS64 += -n
160
161#
162# These libraries have two resulting lint libraries.  If a dependency is
163# declared using these variables, the substitution for the 32/64 versions at
164# lint time happens automatically (see Makefile.targ).
165#
166LD_LIB =	-lld
167LD_LIB32 =	-lld32
168LD_LIB64 =	-lld64
169
170LDDBG_LIB =	-llddbg
171LDDBG_LIB32 =	-llddbg32
172LDDBG_LIB64 =	-llddbg64
173
174CONV_LIB =	-lconv
175CONV_LIB32 =	-lconv32
176CONV_LIB64 =	-lconv64
177