xref: /titanic_44/usr/src/cmd/sgs/Makefile.com (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
24*7c478bd9Sstevel@tonic-gate#
25*7c478bd9Sstevel@tonic-gate# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate# cmd/sgs/Makefile.com
29*7c478bd9Sstevel@tonic-gate
30*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gateinclude		$(SRC)/cmd/sgs/Makefile.var
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gateSRCBASE=	../../../..
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gatei386_ARCH=	$(VAR_I386_ARCH)
37*7c478bd9Sstevel@tonic-gatesparc_ARCH=	sparc
38*7c478bd9Sstevel@tonic-gate
39*7c478bd9Sstevel@tonic-gateARCH=		$($(MACH)_ARCH)
40*7c478bd9Sstevel@tonic-gate
41*7c478bd9Sstevel@tonic-gateROOTCCSBIN64=		$(ROOTCCSBIN)/$(MACH64)
42*7c478bd9Sstevel@tonic-gateROOTCCSBINPROG64=	$(PROG:%=$(ROOTCCSBIN64)/%)
43*7c478bd9Sstevel@tonic-gate
44*7c478bd9Sstevel@tonic-gate# Establish any global flags.
45*7c478bd9Sstevel@tonic-gate
46*7c478bd9Sstevel@tonic-gate# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...")
47*7c478bd9Sstevel@tonic-gate# enables ASSERT() checking in the library
48*7c478bd9Sstevel@tonic-gate# This is automatically enabled for DEBUG builds, not for non debug builds.
49*7c478bd9Sstevel@tonic-gateDEBUG=
50*7c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG
51*7c478bd9Sstevel@tonic-gate
52*7c478bd9Sstevel@tonic-gateCFLAGS +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
53*7c478bd9Sstevel@tonic-gateCFLAGS64 +=	$(CCVERBOSE) $(DEBUG) $(XFFLAG)
54*7c478bd9Sstevel@tonic-gate
55*7c478bd9Sstevel@tonic-gate# Reassign CPPFLAGS so that local search paths are used before any parent
56*7c478bd9Sstevel@tonic-gate# $ROOT paths.
57*7c478bd9Sstevel@tonic-gateCPPFLAGS=	-I. -I../common -I../../include -I../../include/$(MACH) \
58*7c478bd9Sstevel@tonic-gate		$(VAR_CPPFLAGS) $(CPPFLAGS.master)
59*7c478bd9Sstevel@tonic-gate
60*7c478bd9Sstevel@tonic-gate# PICS64 is unique to our environment
61*7c478bd9Sstevel@tonic-gate$(PICS64) :=	sparc_CFLAGS += -xregs=no%appl -K pic
62*7c478bd9Sstevel@tonic-gate$(PICS64) :=	sparcv9_CFLAGS += -xregs=no%appl -K pic
63*7c478bd9Sstevel@tonic-gate$(PICS64) :=	CPPFLAGS += -DPIC -D_REENTRANT
64*7c478bd9Sstevel@tonic-gate
65*7c478bd9Sstevel@tonic-gateLDZIGNORE=	-zignore
66*7c478bd9Sstevel@tonic-gateLDFLAGS +=	$(LDZIGNORE)
67*7c478bd9Sstevel@tonic-gateDYNFLAGS +=	$(LDZIGNORE)
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gate# Establish the local tools, proto and package area.
70*7c478bd9Sstevel@tonic-gate
71*7c478bd9Sstevel@tonic-gateSGSHOME=	$(SRC)/cmd/sgs
72*7c478bd9Sstevel@tonic-gateSGSPROTO=	$(SGSHOME)/proto/$(MACH)
73*7c478bd9Sstevel@tonic-gateSGSTOOLS=	$(SGSHOME)/tools
74*7c478bd9Sstevel@tonic-gateSGSMSGID=	$(SGSHOME)/messages
75*7c478bd9Sstevel@tonic-gateSGSMSGDIR=	$(SGSHOME)/messages/$(MACH)
76*7c478bd9Sstevel@tonic-gateSGSONLD=	$(ROOT)/opt/SUNWonld
77*7c478bd9Sstevel@tonic-gateSGSRPATH=	/usr/lib
78*7c478bd9Sstevel@tonic-gateSGSRPATH64=	$(SGSRPATH)/$(MACH64)
79*7c478bd9Sstevel@tonic-gate
80*7c478bd9Sstevel@tonic-gate#
81*7c478bd9Sstevel@tonic-gate# Macros to be used to include link against libconv and include
82*7c478bd9Sstevel@tonic-gate# vernote.o
83*7c478bd9Sstevel@tonic-gate#
84*7c478bd9Sstevel@tonic-gateVERSREF=	-ulink_ver_string
85*7c478bd9Sstevel@tonic-gateCONVLIBDIR=	-L$(SGSHOME)/libconv/$(MACH)
86*7c478bd9Sstevel@tonic-gateCONVLIBDIR64=	-L$(SGSHOME)/libconv/$(MACH64)
87*7c478bd9Sstevel@tonic-gate
88*7c478bd9Sstevel@tonic-gateELFLIBDIR=	-L$(SGSHOME)/libelf/$(MACH)
89*7c478bd9Sstevel@tonic-gateELFLIBDIR64=	-L$(SGSHOME)/libelf/$(MACH64)
90*7c478bd9Sstevel@tonic-gate
91*7c478bd9Sstevel@tonic-gateLDDBGLIBDIR=	-L$(SGSHOME)/liblddbg/$(MACH)
92*7c478bd9Sstevel@tonic-gateLDDBGLIBDIR64=	-L$(SGSHOME)/liblddbg/$(MACH64)
93*7c478bd9Sstevel@tonic-gate
94*7c478bd9Sstevel@tonic-gate
95*7c478bd9Sstevel@tonic-gate
96*7c478bd9Sstevel@tonic-gate# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN.  We don't need
97*7c478bd9Sstevel@tonic-gate# this definition as the sgs utilities obtain their domain via sgsmsg(1l).
98*7c478bd9Sstevel@tonic-gate
99*7c478bd9Sstevel@tonic-gateDTEXTDOM=
100*7c478bd9Sstevel@tonic-gate
101*7c478bd9Sstevel@tonic-gate
102*7c478bd9Sstevel@tonic-gate# Define any generic sgsmsg(1l) flags.  The default message generation system
103*7c478bd9Sstevel@tonic-gate# is to use gettext(3i), add the -C flag to switch to catgets(3c).
104*7c478bd9Sstevel@tonic-gate
105*7c478bd9Sstevel@tonic-gateSGSMSG=		$(SGSTOOLS)/$(MACH)/sgsmsg
106*7c478bd9Sstevel@tonic-gateCHKMSG=		$(SGSTOOLS)/chkmsg.sh
107*7c478bd9Sstevel@tonic-gate
108*7c478bd9Sstevel@tonic-gateSGSMSGVFLAG =
109*7c478bd9Sstevel@tonic-gateSGSMSGFLAGS =	$(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
110*7c478bd9Sstevel@tonic-gateCHKMSGFLAGS=	$(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)
111*7c478bd9Sstevel@tonic-gate
112*7c478bd9Sstevel@tonic-gate
113*7c478bd9Sstevel@tonic-gate# Native targets should use the minimum of ld(1) flags to allow building on
114*7c478bd9Sstevel@tonic-gate# previous releases.  We use mapfiles to scope, but don't bother versioning.
115*7c478bd9Sstevel@tonic-gate
116*7c478bd9Sstevel@tonic-gatenative:=	DYNFLAGS = $(MAPOPTS) -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION)
117*7c478bd9Sstevel@tonic-gate
118*7c478bd9Sstevel@tonic-gateUSE_PROTO=	-Yl,$(SGSPROTO)
119*7c478bd9Sstevel@tonic-gate
120*7c478bd9Sstevel@tonic-gate.KEEP_STATE_FILE: .make.state.$(MACH)
121*7c478bd9Sstevel@tonic-gate
122*7c478bd9Sstevel@tonic-gate#
123*7c478bd9Sstevel@tonic-gate# lint-related stuff
124*7c478bd9Sstevel@tonic-gate#
125*7c478bd9Sstevel@tonic-gate
126*7c478bd9Sstevel@tonic-gateDASHES=		"------------------------------------------------------------"
127*7c478bd9Sstevel@tonic-gate
128*7c478bd9Sstevel@tonic-gateLIBNAME32 =	$(LIBNAME:%=%32)
129*7c478bd9Sstevel@tonic-gateLIBNAME64 =	$(LIBNAME:%=%64)
130*7c478bd9Sstevel@tonic-gateLIBNAMES =	$(LIBNAME32) $(LIBNAME64)
131*7c478bd9Sstevel@tonic-gate
132*7c478bd9Sstevel@tonic-gateSGSLINTOUT =	lint.out
133*7c478bd9Sstevel@tonic-gateLINTOUT1 =	lint.out.1
134*7c478bd9Sstevel@tonic-gateLINTOUT32 =	lint.out.32
135*7c478bd9Sstevel@tonic-gateLINTOUT64 =	lint.out.64
136*7c478bd9Sstevel@tonic-gateLINTOUTS =	$(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64)
137*7c478bd9Sstevel@tonic-gate
138*7c478bd9Sstevel@tonic-gateLINTLIBSRC =	$(LINTLIB:%.ln=%)
139*7c478bd9Sstevel@tonic-gateLINTLIB32 =	$(LINTLIB:%.ln=%32.ln)
140*7c478bd9Sstevel@tonic-gateLINTLIB64 =	$(LINTLIB:%.ln=%64.ln)
141*7c478bd9Sstevel@tonic-gateLINTLIBS =	$(LINTLIB32) $(LINTLIB64)
142*7c478bd9Sstevel@tonic-gate
143*7c478bd9Sstevel@tonic-gateLINTFLAGS =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED
144*7c478bd9Sstevel@tonic-gateLINTFLAGS64 =	-m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \
145*7c478bd9Sstevel@tonic-gate		-errchk=longptr64 $(VAR_LINTFLAGS64)
146*7c478bd9Sstevel@tonic-gate
147*7c478bd9Sstevel@tonic-gate#
148*7c478bd9Sstevel@tonic-gate# These libraries have two resulting lint libraries.
149*7c478bd9Sstevel@tonic-gate# If a dependency is declared using these variables,
150*7c478bd9Sstevel@tonic-gate# the substitution for the 32/64 versions at lint time
151*7c478bd9Sstevel@tonic-gate# will happen automatically (see Makefile.targ).
152*7c478bd9Sstevel@tonic-gate#
153*7c478bd9Sstevel@tonic-gateLDDBG_LIB=	-llddbg
154*7c478bd9Sstevel@tonic-gateLDDBG_LIB32=	-llddbg32
155*7c478bd9Sstevel@tonic-gateLDDBG_LIB64=	-llddbg64
156*7c478bd9Sstevel@tonic-gate
157*7c478bd9Sstevel@tonic-gateLD_LIB=		-lld
158*7c478bd9Sstevel@tonic-gateLD_LIB32=	-lld32
159*7c478bd9Sstevel@tonic-gateLD_LIB64=	-lld64
160