xref: /titanic_51/usr/src/cmd/sgs/Makefile.com (revision 43a291055ab3951f6372241323fd4e2486098fff)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/sgs/Makefile.com
29
30.KEEP_STATE:
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=	$(PROG:%=$(ROOTCCSBIN64)/%)
43
44# Establish any global flags.
45
46# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT()
47# checking.  This is automatically enabled for DEBUG builds, not for non-debug
48# builds.  Unset the global C99_DISABLE flag to insure we uncover all compiler
49# warnings/errors.
50DEBUG=
51$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG
52
53C99_DISABLE=	$(C99_ENABLE)
54
55CFLAGS +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
56CFLAGS64 +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
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		$(VAR_CPPFLAGS) $(CPPFLAGS.master)
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
68LDZIGNORE=	-zignore
69LDFLAGS +=	$(LDZIGNORE)
70DYNFLAGS +=	$(LDZIGNORE)
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
85# vernote.o
86#
87VERSREF=	-ulink_ver_string
88CONVLIBDIR=	-L$(SGSHOME)/libconv/$(MACH)
89CONVLIBDIR64=	-L$(SGSHOME)/libconv/$(MACH64)
90
91ELFLIBDIR=	-L$(SGSHOME)/libelf/$(MACH)
92ELFLIBDIR64=	-L$(SGSHOME)/libelf/$(MACH64)
93
94LDDBGLIBDIR=	-L$(SGSHOME)/liblddbg/$(MACH)
95LDDBGLIBDIR64=	-L$(SGSHOME)/liblddbg/$(MACH64)
96
97
98
99# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN.  We don't need
100# this definition as the sgs utilities obtain their domain via sgsmsg(1l).
101
102DTEXTDOM=
103
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
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 = $(MAPOPTS) -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
120
121USE_PROTO=	-Yl,$(SGSPROTO)
122
123.KEEP_STATE_FILE: .make.state.$(MACH)
124
125#
126# lint-related stuff
127#
128
129DASHES=		"------------------------------------------------------------"
130
131LIBNAME32 =	$(LIBNAME:%=%32)
132LIBNAME64 =	$(LIBNAME:%=%64)
133LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
134
135SGSLINTOUT =	lint.out
136LINTOUT1 =	lint.out.1
137LINTOUT32 =	lint.out.32
138LINTOUT64 =	lint.out.64
139LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
140
141LINTLIBSRC =	$(LINTLIB:%.ln=%)
142LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
143LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
144LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
145
146LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
147LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
148		-errchk=longptr64 $(VAR_LINTFLAGS64)
149
150#
151# These libraries have two resulting lint libraries.
152# If a dependency is declared using these variables,
153# the substitution for the 32/64 versions at lint time
154# will happen automatically (see Makefile.targ).
155#
156LDDBG_LIB=	-llddbg
157LDDBG_LIB32=	-llddbg32
158LDDBG_LIB64=	-llddbg64
159
160LD_LIB=		-lld
161LD_LIB32=	-lld32
162LD_LIB64=	-lld64
163