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 (the "License"). 6# You may not use this file except in compliance with the License. 7# 8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9# or http://www.opensolaris.org/os/licensing. 10# See the License for the specific language governing permissions 11# and limitations under the License. 12# 13# When distributing Covered Code, include this CDDL HEADER in each 14# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15# If applicable, add the following below this CDDL HEADER, with the 16# fields enclosed by brackets "[]" replaced with your own identifying 17# information: Portions Copyright [yyyy] [name of copyright owner] 18# 19# CDDL HEADER END 20# 21 22# 23# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28 29.KEEP_STATE: 30.KEEP_STATE_FILE: .make.state.$(MACH) 31 32 33include $(SRC)/cmd/sgs/Makefile.var 34 35SRCBASE = ../../../.. 36 37i386_ARCH = $(VAR_I386_ARCH) 38sparc_ARCH = sparc 39 40ARCH = $($(MACH)_ARCH) 41 42ROOTCCSBIN64 = $(ROOTCCSBIN)/$(MACH64) 43ROOTCCSBINPROG64 = \ 44 $(PROG:%=$(ROOTCCSBIN64)/%) 45 46# Establish any global flags. 47 48# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT() 49# checking. This is automatically enabled for DEBUG builds, not for non-debug 50# builds. Unset the global C99_DISABLE flag to insure we uncover all compiler 51# warnings/errors. 52DEBUG = 53$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG 54 55C99_DISABLE = $(C99_ENABLE) 56 57CFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 58CFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 59 60# Reassign CPPFLAGS so that local search paths are used before any parent 61# $ROOT paths. 62CPPFLAGS = -I. -I../common -I../../include -I../../include/$(MACH) \ 63 $(VAR_CPPFLAGS) $(CPPFLAGS.master) 64 65# PICS64 is unique to our environment 66$(PICS64) := sparc_CFLAGS += -xregs=no%appl -K pic 67$(PICS64) := sparcv9_CFLAGS += -xregs=no%appl -K pic 68$(PICS64) := CPPFLAGS += -DPIC -D_REENTRANT 69 70LDFLAGS += $(ZIGNORE) 71DYNFLAGS += $(ZIGNORE) 72 73# Establish the local tools, proto and package area. 74 75SGSHOME = $(SRC)/cmd/sgs 76SGSPROTO = $(SGSHOME)/proto/$(MACH) 77SGSTOOLS = $(SGSHOME)/tools 78SGSMSGID = $(SGSHOME)/messages 79SGSMSGDIR = $(SGSHOME)/messages/$(MACH) 80SGSONLD = $(ROOT)/opt/SUNWonld 81SGSRPATH = /usr/lib 82SGSRPATH64 = $(SGSRPATH)/$(MACH64) 83 84# 85# Macros to be used to include link against libconv and include vernote.o 86# 87VERSREF = -ulink_ver_string 88 89LDLIBDIR = -L$(SGSHOME)/libld/$(MACH) 90LDLIBDIR64 = -L$(SGSHOME)/libld/$(MACH64) 91 92CONVLIBDIR = -L$(SGSHOME)/libconv/$(MACH) 93CONVLIBDIR64 = -L$(SGSHOME)/libconv/$(MACH64) 94 95ELFLIBDIR = -L$(SGSHOME)/libelf/$(MACH) 96ELFLIBDIR64 = -L$(SGSHOME)/libelf/$(MACH64) 97 98LDDBGLIBDIR = -L$(SGSHOME)/liblddbg/$(MACH) 99LDDBGLIBDIR64 = -L$(SGSHOME)/liblddbg/$(MACH64) 100 101# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN. We don't need 102# this definition as the sgs utilities obtain their domain via sgsmsg(1l). 103 104DTEXTDOM = 105 106# Define any generic sgsmsg(1l) flags. The default message generation system 107# is to use gettext(3i), add the -C flag to switch to catgets(3c). 108 109SGSMSG = $(SGSTOOLS)/$(MACH)/sgsmsg 110CHKMSG = $(SGSTOOLS)/chkmsg.sh 111 112SGSMSGVFLAG = 113SGSMSGFLAGS = $(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident 114CHKMSGFLAGS = $(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %) 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# 124# lint-related stuff 125# 126 127DASHES = "------------------------------------------------------------" 128 129LIBNAME32 = $(LIBNAME:%=%32) 130LIBNAME64 = $(LIBNAME:%=%64) 131LIBNAMES = $(LIBNAME32) $(LIBNAME64) 132 133SGSLINTOUT = lint.out 134LINTOUT1 = lint.out.1 135LINTOUT32 = lint.out.32 136LINTOUT64 = lint.out.64 137LINTOUTS = $(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64) 138 139LINTLIBSRC = $(LINTLIB:%.ln=%) 140LINTLIB32 = $(LINTLIB:%.ln=%32.ln) 141LINTLIB64 = $(LINTLIB:%.ln=%64.ln) 142LINTLIBS = $(LINTLIB32) $(LINTLIB64) 143 144LINTFLAGS = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 145LINTFLAGS64 = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \ 146 $(VAR_LINTFLAGS64) \ 147 148# 149# These libraries have two resulting lint libraries. If a dependency is 150# declared using these variables, the substitution for the 32/64 versions at 151# lint time happens automatically (see Makefile.targ). 152# 153LD_LIB = -lld 154LD_LIB32 = -lld32 155LD_LIB64 = -lld64 156 157LDDBG_LIB = -llddbg 158LDDBG_LIB32 = -llddbg32 159LDDBG_LIB64 = -llddbg64 160 161CONV_LIB = -lconv 162CONV_LIB32 = -lconv32 163CONV_LIB64 = -lconv64 164