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 (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. 24# Copyright 2016 RackTop Systems. 25# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. 26# 27 28.KEEP_STATE: 29.KEEP_STATE_FILE: .make.state.$(MACH) 30 31 32include $(SRC)/cmd/sgs/Makefile.var 33 34SRCBASE = ../../../.. 35 36i386_ARCH = intel 37sparc_ARCH = sparc 38 39ARCH = $($(MACH)_ARCH) 40 41# Establish any global flags. 42 43# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT() 44# checking. This is automatically enabled for DEBUG builds, not for non-debug 45# builds. Unset the global CSTD_GNU89 flag to insure we uncover all compiler 46# warnings/errors. 47DEBUG = 48$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG 49 50CSTD_GNU89 = $(CSTD_GNU99) 51 52CFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 53CFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 54 55CERRWARN += -_gcc=-Wno-type-limits 56CERRWARN += -_gcc=-Wno-parentheses 57CERRWARN += -_gcc=-Wno-unused-value 58 59# 60# Location of the shared elfcap code 61# 62ELFCAP= $(SRC)/common/elfcap 63 64# Reassign CPPFLAGS so that local search paths are used before any parent 65# $ROOT paths. 66CPPFLAGS = -I. -I../common -I../../include -I../../include/$(MACH) \ 67 $(CPPFLAGS.master) -I$(ELFCAP) 68 69# PICS64 is unique to our environment 70$(PICS64) := sparc_CFLAGS += -xregs=no%appl $(C_PICFLAGS) 71$(PICS64) := sparcv9_CFLAGS += -xregs=no%appl $(C_PICFLAGS) 72$(PICS64) := CPPFLAGS += -DPIC -D_REENTRANT 73 74LDFLAGS += $(ZIGNORE) 75DYNFLAGS += $(ZIGNORE) 76 77# Establish the local tools, proto and package area. 78 79SGSHOME = $(SRC)/cmd/sgs 80SGSPROTO = $(SGSHOME)/proto/$(MACH) 81SGSTOOLS = $(SGSHOME)/tools 82SGSMSGID = $(SGSHOME)/messages 83SGSMSGDIR = $(SGSHOME)/messages/$(MACH) 84SGSONLD = $(ROOT)/opt/SUNWonld 85SGSRPATH = /usr/lib 86SGSRPATH64 = $(SGSRPATH)/$(MACH64) 87 88# Mimic the structure of an installed system. 89 90SGSLIBDIR = $(SGSPROTO)/lib 91SGSPREFIX = $(SGSPROTO)/usr 92SGSBINDIR = $(SGSPREFIX)/bin 93 94# 95# Macros to be used to include link against libconv and include vernote.o 96# 97VERSREF = -ulink_ver_string 98 99LDLIBDIR = -L$(SGSHOME)/libld/$(MACH) 100LDLIBDIR64 = -L$(SGSHOME)/libld/$(MACH64) 101 102CONVLIBDIR = -L$(SGSHOME)/libconv/$(MACH) 103CONVLIBDIR64 = -L$(SGSHOME)/libconv/$(MACH64) 104 105ELFLIBDIR = -L$(SGSHOME)/libelf/$(MACH) 106ELFLIBDIR64 = -L$(SGSHOME)/libelf/$(MACH64) 107 108LDDBGLIBDIR = -L$(SGSHOME)/liblddbg/$(MACH) 109LDDBGLIBDIR64 = -L$(SGSHOME)/liblddbg/$(MACH64) 110 111 112# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN. We don't need 113# this definition as the sgs utilities obtain their domain via sgsmsg(1l). 114 115DTEXTDOM = 116 117# Define any generic sgsmsg(1l) flags. The default message generation system 118# is to use gettext(3i), add the -C flag to switch to catgets(3c). 119 120SGSMSG = $(SGSTOOLS)/$(MACH)/sgsmsg 121SGSMSG_PIGLATIN_NL = perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl 122CHKMSG = $(SGSTOOLS)/chkmsg.sh 123 124SGSMSGVFLAG = 125SGSMSGFLAGS = $(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident 126CHKMSGFLAGS = $(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %) 127 128# Native targets should use the minimum of ld(1) flags to allow building on 129# previous releases. We use mapfiles to scope, but don't bother versioning. 130 131native := DYNFLAGS = -R$(SGSLIBDIR) -L$(SGSLIBDIR) $(ZNOVERSION) \ 132 $(HSONAME) 133 134# Comment out the following two lines to have the sgs built from the system 135# link-editor, rather than the local proto link-editor. 136CC_USE_PROTO = -Yl,$(SGSBINDIR) 137LD_USE_PROTO = $(SGSBINDIR)/ 138 139LD_LIB = -lld 140LD_LIB32 = -lld32 141LD_LIB64 = -lld64 142 143LDDBG_LIB = -llddbg 144LDDBG_LIB32 = -llddbg32 145LDDBG_LIB64 = -llddbg64 146 147CONV_LIB = -lconv 148CONV_LIB32 = -lconv32 149CONV_LIB64 = -lconv64 150