xref: /titanic_51/usr/src/cmd/sgs/Makefile.com (revision 42487ff1899d230ad6c2d55cf9573489ca5eb770)
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
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
84# vernote.o
85#
86VERSREF=	-ulink_ver_string
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
97
98# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN.  We don't need
99# this definition as the sgs utilities obtain their domain via sgsmsg(1l).
100
101DTEXTDOM=
102
103
104# Define any generic sgsmsg(1l) flags.  The default message generation system
105# is to use gettext(3i), add the -C flag to switch to catgets(3c).
106
107SGSMSG=		$(SGSTOOLS)/$(MACH)/sgsmsg
108CHKMSG=		$(SGSTOOLS)/chkmsg.sh
109
110SGSMSGVFLAG =
111SGSMSGFLAGS =	$(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
112CHKMSGFLAGS=	$(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)
113
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 = $(MAPOPTS) -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
119
120USE_PROTO=	-Yl,$(SGSPROTO)
121
122.KEEP_STATE_FILE: .make.state.$(MACH)
123
124#
125# lint-related stuff
126#
127
128DASHES=		"------------------------------------------------------------"
129
130LIBNAME32 =	$(LIBNAME:%=%32)
131LIBNAME64 =	$(LIBNAME:%=%64)
132LIBNAMES =	$(LIBNAME32) $(LIBNAME64)
133
134SGSLINTOUT =	lint.out
135LINTOUT1 =	lint.out.1
136LINTOUT32 =	lint.out.32
137LINTOUT64 =	lint.out.64
138LINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
139
140LINTLIBSRC =	$(LINTLIB:%.ln=%)
141LINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
142LINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
143LINTLIBS =	$(LINTLIB32) $(LINTLIB64)
144
145LINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
146LINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
147		-errchk=longptr64 $(VAR_LINTFLAGS64)
148
149#
150# These libraries have two resulting lint libraries.
151# If a dependency is declared using these variables,
152# the substitution for the 32/64 versions at lint time
153# will happen automatically (see Makefile.targ).
154#
155LDDBG_LIB=	-llddbg
156LDDBG_LIB32=	-llddbg32
157LDDBG_LIB64=	-llddbg64
158
159LD_LIB=		-lld
160LD_LIB32=	-lld32
161LD_LIB64=	-lld64
162