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 55aefb655Srie# Common Development and Distribution License (the "License"). 65aefb655Srie# You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate# 87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate# and limitations under the License. 127c478bd9Sstevel@tonic-gate# 137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate# 197c478bd9Sstevel@tonic-gate# CDDL HEADER END 207c478bd9Sstevel@tonic-gate# 2108278a5eSRod Evans 225aefb655Srie# 2320c1c355SRod Evans# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. 247c478bd9Sstevel@tonic-gate# 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate.KEEP_STATE: 275aefb655Srie.KEEP_STATE_FILE: .make.state.$(MACH) 285aefb655Srie 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gateinclude $(SRC)/cmd/sgs/Makefile.var 317c478bd9Sstevel@tonic-gate 327c478bd9Sstevel@tonic-gateSRCBASE = ../../../.. 337c478bd9Sstevel@tonic-gate 3456deab07SRod Evansi386_ARCH = intel 357c478bd9Sstevel@tonic-gatesparc_ARCH = sparc 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gateARCH = $($(MACH)_ARCH) 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate# Establish any global flags. 407c478bd9Sstevel@tonic-gate 41b3fbe5e6Sseizo# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT() 42b3fbe5e6Sseizo# checking. This is automatically enabled for DEBUG builds, not for non-debug 43b3fbe5e6Sseizo# builds. Unset the global C99_DISABLE flag to insure we uncover all compiler 44b3fbe5e6Sseizo# warnings/errors. 457c478bd9Sstevel@tonic-gateDEBUG = 467c478bd9Sstevel@tonic-gate$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG 477c478bd9Sstevel@tonic-gate 48b3fbe5e6SseizoC99_DISABLE = $(C99_ENABLE) 49b3fbe5e6Sseizo 507c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 517c478bd9Sstevel@tonic-gateCFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 527c478bd9Sstevel@tonic-gate 53*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-type-limits 54*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 55*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-value 56*7014882cSRichard Lowe 5769112eddSAli Bahrami# 5869112eddSAli Bahrami# Location of the shared elfcap code 5969112eddSAli Bahrami# 6069112eddSAli BahramiELFCAP= $(SRC)/common/elfcap 6169112eddSAli Bahrami 627c478bd9Sstevel@tonic-gate# Reassign CPPFLAGS so that local search paths are used before any parent 637c478bd9Sstevel@tonic-gate# $ROOT paths. 647c478bd9Sstevel@tonic-gateCPPFLAGS = -I. -I../common -I../../include -I../../include/$(MACH) \ 6520c1c355SRod Evans $(CPPFLAGS.master) -I$(ELFCAP) 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gate# PICS64 is unique to our environment 687c478bd9Sstevel@tonic-gate$(PICS64) := sparc_CFLAGS += -xregs=no%appl -K pic 697c478bd9Sstevel@tonic-gate$(PICS64) := sparcv9_CFLAGS += -xregs=no%appl -K pic 707c478bd9Sstevel@tonic-gate$(PICS64) := CPPFLAGS += -DPIC -D_REENTRANT 717c478bd9Sstevel@tonic-gate 72fb1354edSrieLDFLAGS += $(ZIGNORE) 73fb1354edSrieDYNFLAGS += $(ZIGNORE) 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate# Establish the local tools, proto and package area. 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gateSGSHOME = $(SRC)/cmd/sgs 787c478bd9Sstevel@tonic-gateSGSPROTO = $(SGSHOME)/proto/$(MACH) 797c478bd9Sstevel@tonic-gateSGSTOOLS = $(SGSHOME)/tools 807c478bd9Sstevel@tonic-gateSGSMSGID = $(SGSHOME)/messages 817c478bd9Sstevel@tonic-gateSGSMSGDIR = $(SGSHOME)/messages/$(MACH) 827c478bd9Sstevel@tonic-gateSGSONLD = $(ROOT)/opt/SUNWonld 837c478bd9Sstevel@tonic-gateSGSRPATH = /usr/lib 847c478bd9Sstevel@tonic-gateSGSRPATH64 = $(SGSRPATH)/$(MACH64) 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate# 875aefb655Srie# Macros to be used to include link against libconv and include vernote.o 887c478bd9Sstevel@tonic-gate# 897c478bd9Sstevel@tonic-gateVERSREF = -ulink_ver_string 905aefb655Srie 915aefb655SrieLDLIBDIR = -L$(SGSHOME)/libld/$(MACH) 925aefb655SrieLDLIBDIR64 = -L$(SGSHOME)/libld/$(MACH64) 935aefb655Srie 947c478bd9Sstevel@tonic-gateCONVLIBDIR = -L$(SGSHOME)/libconv/$(MACH) 957c478bd9Sstevel@tonic-gateCONVLIBDIR64 = -L$(SGSHOME)/libconv/$(MACH64) 967c478bd9Sstevel@tonic-gate 977c478bd9Sstevel@tonic-gateELFLIBDIR = -L$(SGSHOME)/libelf/$(MACH) 987c478bd9Sstevel@tonic-gateELFLIBDIR64 = -L$(SGSHOME)/libelf/$(MACH64) 997c478bd9Sstevel@tonic-gate 1007c478bd9Sstevel@tonic-gateLDDBGLIBDIR = -L$(SGSHOME)/liblddbg/$(MACH) 1017c478bd9Sstevel@tonic-gateLDDBGLIBDIR64 = -L$(SGSHOME)/liblddbg/$(MACH64) 1027c478bd9Sstevel@tonic-gate 10369112eddSAli Bahrami 1047c478bd9Sstevel@tonic-gate# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN. We don't need 1057c478bd9Sstevel@tonic-gate# this definition as the sgs utilities obtain their domain via sgsmsg(1l). 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gateDTEXTDOM = 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate# Define any generic sgsmsg(1l) flags. The default message generation system 1107c478bd9Sstevel@tonic-gate# is to use gettext(3i), add the -C flag to switch to catgets(3c). 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gateSGSMSG = $(SGSTOOLS)/$(MACH)/sgsmsg 113d29b2c44Sab196087SGSMSG_PIGLATIN_NL = perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl 1147c478bd9Sstevel@tonic-gateCHKMSG = $(SGSTOOLS)/chkmsg.sh 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gateSGSMSGVFLAG = 1177c478bd9Sstevel@tonic-gateSGSMSGFLAGS = $(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident 1187c478bd9Sstevel@tonic-gateCHKMSGFLAGS = $(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %) 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate# Native targets should use the minimum of ld(1) flags to allow building on 1217c478bd9Sstevel@tonic-gate# previous releases. We use mapfiles to scope, but don't bother versioning. 1227c478bd9Sstevel@tonic-gate 123f808c858Srafnative := DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION) 1247c478bd9Sstevel@tonic-gate 12508278a5eSRod Evans# Comment out the following two lines to have the sgs built from the system 12608278a5eSRod Evans# link-editor, rather than the local proto link-editor. 12708278a5eSRod EvansCC_USE_PROTO = -Yl,$(SGSPROTO) 12808278a5eSRod EvansLD_USE_PROTO = $(SGSPROTO)/ 1297c478bd9Sstevel@tonic-gate 1307c478bd9Sstevel@tonic-gate# 1317c478bd9Sstevel@tonic-gate# lint-related stuff 1327c478bd9Sstevel@tonic-gate# 1337c478bd9Sstevel@tonic-gateLIBNAME32 = $(LIBNAME:%=%32) 1347c478bd9Sstevel@tonic-gateLIBNAME64 = $(LIBNAME:%=%64) 1357c478bd9Sstevel@tonic-gateLIBNAMES = $(LIBNAME32) $(LIBNAME64) 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gateSGSLINTOUT = lint.out 1387c478bd9Sstevel@tonic-gateLINTOUT1 = lint.out.1 1397c478bd9Sstevel@tonic-gateLINTOUT32 = lint.out.32 1407c478bd9Sstevel@tonic-gateLINTOUT64 = lint.out.64 1417c478bd9Sstevel@tonic-gateLINTOUTS = $(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64) 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gateLINTLIBSRC = $(LINTLIB:%.ln=%) 1447c478bd9Sstevel@tonic-gateLINTLIB32 = $(LINTLIB:%.ln=%32.ln) 1457c478bd9Sstevel@tonic-gateLINTLIB64 = $(LINTLIB:%.ln=%64.ln) 1467c478bd9Sstevel@tonic-gateLINTLIBS = $(LINTLIB32) $(LINTLIB64) 1477c478bd9Sstevel@tonic-gate 1487c478bd9Sstevel@tonic-gateLINTFLAGS = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 1497c478bd9Sstevel@tonic-gateLINTFLAGS64 = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \ 15008278a5eSRod Evans $(VAR_LINTFLAGS64) 15108278a5eSRod Evans 15208278a5eSRod Evans# 15308278a5eSRod Evans# When building a lint library, no other lint libraries are verified as 15408278a5eSRod Evans# dependencies, nor is the stardard C lint library processed. All dependency 15508278a5eSRod Evans# verification is carried out through linting the sources themselves. 15608278a5eSRod Evans# 15708278a5eSRod Evans$(LINTLIB) := LINTFLAGS += -n 15808278a5eSRod Evans$(LINTLIB) := LINTFLAGS64 += -n 15908278a5eSRod Evans 16008278a5eSRod Evans$(LINTLIB32) := LINTFLAGS += -n 16108278a5eSRod Evans$(LINTLIB32) := LINTFLAGS64 += -n 16208278a5eSRod Evans$(LINTLIB64) := LINTFLAGS += -n 16308278a5eSRod Evans$(LINTLIB64) := LINTFLAGS64 += -n 1647c478bd9Sstevel@tonic-gate 1657c478bd9Sstevel@tonic-gate# 1665aefb655Srie# These libraries have two resulting lint libraries. If a dependency is 1675aefb655Srie# declared using these variables, the substitution for the 32/64 versions at 1685aefb655Srie# lint time happens automatically (see Makefile.targ). 1697c478bd9Sstevel@tonic-gate# 1705aefb655SrieLD_LIB = -lld 1715aefb655SrieLD_LIB32 = -lld32 1725aefb655SrieLD_LIB64 = -lld64 1735aefb655Srie 1747c478bd9Sstevel@tonic-gateLDDBG_LIB = -llddbg 1757c478bd9Sstevel@tonic-gateLDDBG_LIB32 = -llddbg32 1767c478bd9Sstevel@tonic-gateLDDBG_LIB64 = -llddbg64 1777c478bd9Sstevel@tonic-gate 1785aefb655SrieCONV_LIB = -lconv 1795aefb655SrieCONV_LIB32 = -lconv32 1805aefb655SrieCONV_LIB64 = -lconv64 181