17c478bd9Sstevel@tonic-gate# 27c478bd9Sstevel@tonic-gate# CDDL HEADER START 37c478bd9Sstevel@tonic-gate# 47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate# with the License. 87c478bd9Sstevel@tonic-gate# 97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate# and limitations under the License. 137c478bd9Sstevel@tonic-gate# 147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate# 207c478bd9Sstevel@tonic-gate# CDDL HEADER END 217c478bd9Sstevel@tonic-gate# 227c478bd9Sstevel@tonic-gate# 237c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 247c478bd9Sstevel@tonic-gate# 25b3fbe5e6Sseizo# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 267c478bd9Sstevel@tonic-gate# Use is subject to license terms. 277c478bd9Sstevel@tonic-gate# 287c478bd9Sstevel@tonic-gate# cmd/sgs/Makefile.com 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate.KEEP_STATE: 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/sgs/Makefile.var 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gateSRCBASE= ../../../.. 357c478bd9Sstevel@tonic-gate 367c478bd9Sstevel@tonic-gatei386_ARCH= $(VAR_I386_ARCH) 377c478bd9Sstevel@tonic-gatesparc_ARCH= sparc 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gateARCH= $($(MACH)_ARCH) 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gateROOTCCSBIN64= $(ROOTCCSBIN)/$(MACH64) 427c478bd9Sstevel@tonic-gateROOTCCSBINPROG64= $(PROG:%=$(ROOTCCSBIN64)/%) 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gate# Establish any global flags. 457c478bd9Sstevel@tonic-gate 46b3fbe5e6Sseizo# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT() 47b3fbe5e6Sseizo# checking. This is automatically enabled for DEBUG builds, not for non-debug 48b3fbe5e6Sseizo# builds. Unset the global C99_DISABLE flag to insure we uncover all compiler 49b3fbe5e6Sseizo# warnings/errors. 507c478bd9Sstevel@tonic-gateDEBUG= 517c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG 527c478bd9Sstevel@tonic-gate 53b3fbe5e6SseizoC99_DISABLE= $(C99_ENABLE) 54b3fbe5e6Sseizo 557c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 567c478bd9Sstevel@tonic-gateCFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate# Reassign CPPFLAGS so that local search paths are used before any parent 597c478bd9Sstevel@tonic-gate# $ROOT paths. 607c478bd9Sstevel@tonic-gateCPPFLAGS= -I. -I../common -I../../include -I../../include/$(MACH) \ 617c478bd9Sstevel@tonic-gate $(VAR_CPPFLAGS) $(CPPFLAGS.master) 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate# PICS64 is unique to our environment 647c478bd9Sstevel@tonic-gate$(PICS64) := sparc_CFLAGS += -xregs=no%appl -K pic 657c478bd9Sstevel@tonic-gate$(PICS64) := sparcv9_CFLAGS += -xregs=no%appl -K pic 667c478bd9Sstevel@tonic-gate$(PICS64) := CPPFLAGS += -DPIC -D_REENTRANT 677c478bd9Sstevel@tonic-gate 68*fb1354edSrieLDFLAGS += $(ZIGNORE) 69*fb1354edSrieDYNFLAGS += $(ZIGNORE) 707c478bd9Sstevel@tonic-gate 717c478bd9Sstevel@tonic-gate# Establish the local tools, proto and package area. 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gateSGSHOME= $(SRC)/cmd/sgs 747c478bd9Sstevel@tonic-gateSGSPROTO= $(SGSHOME)/proto/$(MACH) 757c478bd9Sstevel@tonic-gateSGSTOOLS= $(SGSHOME)/tools 767c478bd9Sstevel@tonic-gateSGSMSGID= $(SGSHOME)/messages 777c478bd9Sstevel@tonic-gateSGSMSGDIR= $(SGSHOME)/messages/$(MACH) 787c478bd9Sstevel@tonic-gateSGSONLD= $(ROOT)/opt/SUNWonld 797c478bd9Sstevel@tonic-gateSGSRPATH= /usr/lib 807c478bd9Sstevel@tonic-gateSGSRPATH64= $(SGSRPATH)/$(MACH64) 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate# 837c478bd9Sstevel@tonic-gate# Macros to be used to include link against libconv and include 847c478bd9Sstevel@tonic-gate# vernote.o 857c478bd9Sstevel@tonic-gate# 867c478bd9Sstevel@tonic-gateVERSREF= -ulink_ver_string 877c478bd9Sstevel@tonic-gateCONVLIBDIR= -L$(SGSHOME)/libconv/$(MACH) 887c478bd9Sstevel@tonic-gateCONVLIBDIR64= -L$(SGSHOME)/libconv/$(MACH64) 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gateELFLIBDIR= -L$(SGSHOME)/libelf/$(MACH) 917c478bd9Sstevel@tonic-gateELFLIBDIR64= -L$(SGSHOME)/libelf/$(MACH64) 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gateLDDBGLIBDIR= -L$(SGSHOME)/liblddbg/$(MACH) 947c478bd9Sstevel@tonic-gateLDDBGLIBDIR64= -L$(SGSHOME)/liblddbg/$(MACH64) 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gate 987c478bd9Sstevel@tonic-gate# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN. We don't need 997c478bd9Sstevel@tonic-gate# this definition as the sgs utilities obtain their domain via sgsmsg(1l). 1007c478bd9Sstevel@tonic-gate 1017c478bd9Sstevel@tonic-gateDTEXTDOM= 1027c478bd9Sstevel@tonic-gate 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate# Define any generic sgsmsg(1l) flags. The default message generation system 1057c478bd9Sstevel@tonic-gate# is to use gettext(3i), add the -C flag to switch to catgets(3c). 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gateSGSMSG= $(SGSTOOLS)/$(MACH)/sgsmsg 1087c478bd9Sstevel@tonic-gateCHKMSG= $(SGSTOOLS)/chkmsg.sh 1097c478bd9Sstevel@tonic-gate 1107c478bd9Sstevel@tonic-gateSGSMSGVFLAG = 1117c478bd9Sstevel@tonic-gateSGSMSGFLAGS = $(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident 1127c478bd9Sstevel@tonic-gateCHKMSGFLAGS= $(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %) 1137c478bd9Sstevel@tonic-gate 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate# Native targets should use the minimum of ld(1) flags to allow building on 1167c478bd9Sstevel@tonic-gate# previous releases. We use mapfiles to scope, but don't bother versioning. 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gatenative:= DYNFLAGS = $(MAPOPTS) -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION) 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gateUSE_PROTO= -Yl,$(SGSPROTO) 1217c478bd9Sstevel@tonic-gate 1227c478bd9Sstevel@tonic-gate.KEEP_STATE_FILE: .make.state.$(MACH) 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gate# 1257c478bd9Sstevel@tonic-gate# lint-related stuff 1267c478bd9Sstevel@tonic-gate# 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gateDASHES= "------------------------------------------------------------" 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gateLIBNAME32 = $(LIBNAME:%=%32) 1317c478bd9Sstevel@tonic-gateLIBNAME64 = $(LIBNAME:%=%64) 1327c478bd9Sstevel@tonic-gateLIBNAMES = $(LIBNAME32) $(LIBNAME64) 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gateSGSLINTOUT = lint.out 1357c478bd9Sstevel@tonic-gateLINTOUT1 = lint.out.1 1367c478bd9Sstevel@tonic-gateLINTOUT32 = lint.out.32 1377c478bd9Sstevel@tonic-gateLINTOUT64 = lint.out.64 1387c478bd9Sstevel@tonic-gateLINTOUTS = $(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64) 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gateLINTLIBSRC = $(LINTLIB:%.ln=%) 1417c478bd9Sstevel@tonic-gateLINTLIB32 = $(LINTLIB:%.ln=%32.ln) 1427c478bd9Sstevel@tonic-gateLINTLIB64 = $(LINTLIB:%.ln=%64.ln) 1437c478bd9Sstevel@tonic-gateLINTLIBS = $(LINTLIB32) $(LINTLIB64) 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gateLINTFLAGS = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 1467c478bd9Sstevel@tonic-gateLINTFLAGS64 = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \ 1477c478bd9Sstevel@tonic-gate -errchk=longptr64 $(VAR_LINTFLAGS64) 1487c478bd9Sstevel@tonic-gate 1497c478bd9Sstevel@tonic-gate# 1507c478bd9Sstevel@tonic-gate# These libraries have two resulting lint libraries. 1517c478bd9Sstevel@tonic-gate# If a dependency is declared using these variables, 1527c478bd9Sstevel@tonic-gate# the substitution for the 32/64 versions at lint time 1537c478bd9Sstevel@tonic-gate# will happen automatically (see Makefile.targ). 1547c478bd9Sstevel@tonic-gate# 1557c478bd9Sstevel@tonic-gateLDDBG_LIB= -llddbg 1567c478bd9Sstevel@tonic-gateLDDBG_LIB32= -llddbg32 1577c478bd9Sstevel@tonic-gateLDDBG_LIB64= -llddbg64 1587c478bd9Sstevel@tonic-gate 1597c478bd9Sstevel@tonic-gateLD_LIB= -lld 1607c478bd9Sstevel@tonic-gateLD_LIB32= -lld32 1617c478bd9Sstevel@tonic-gateLD_LIB64= -lld64 162