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# 26 27.KEEP_STATE: 28.KEEP_STATE_FILE: .make.state.$(MACH) 29 30 31include $(SRC)/cmd/sgs/Makefile.var 32 33SRCBASE = ../../../.. 34 35i386_ARCH = intel 36sparc_ARCH = sparc 37 38ARCH = $($(MACH)_ARCH) 39 40# Establish any global flags. 41 42# Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT() 43# checking. This is automatically enabled for DEBUG builds, not for non-debug 44# builds. Unset the global C99_DISABLE flag to insure we uncover all compiler 45# warnings/errors. 46DEBUG = 47$(NOT_RELEASE_BUILD)DEBUG = -DDEBUG 48 49C99_DISABLE = $(C99_ENABLE) 50 51CFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 52CFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG) 53 54CERRWARN += -_gcc=-Wno-type-limits 55CERRWARN += -_gcc=-Wno-parentheses 56CERRWARN += -_gcc=-Wno-unused-value 57 58# 59# Location of the shared elfcap code 60# 61ELFCAP= $(SRC)/common/elfcap 62 63# Reassign CPPFLAGS so that local search paths are used before any parent 64# $ROOT paths. 65CPPFLAGS = -I. -I../common -I../../include -I../../include/$(MACH) \ 66 $(CPPFLAGS.master) -I$(ELFCAP) 67 68# PICS64 is unique to our environment 69$(PICS64) := sparc_CFLAGS += -xregs=no%appl -K pic 70$(PICS64) := sparcv9_CFLAGS += -xregs=no%appl -K pic 71$(PICS64) := CPPFLAGS += -DPIC -D_REENTRANT 72 73LDFLAGS += $(ZIGNORE) 74DYNFLAGS += $(ZIGNORE) 75 76# Establish the local tools, proto and package area. 77 78SGSHOME = $(SRC)/cmd/sgs 79SGSPROTO = $(SGSHOME)/proto/$(MACH) 80SGSTOOLS = $(SGSHOME)/tools 81SGSMSGID = $(SGSHOME)/messages 82SGSMSGDIR = $(SGSHOME)/messages/$(MACH) 83SGSONLD = $(ROOT)/opt/SUNWonld 84SGSRPATH = /usr/lib 85SGSRPATH64 = $(SGSRPATH)/$(MACH64) 86 87# 88# Macros to be used to include link against libconv and include vernote.o 89# 90VERSREF = -ulink_ver_string 91 92LDLIBDIR = -L$(SGSHOME)/libld/$(MACH) 93LDLIBDIR64 = -L$(SGSHOME)/libld/$(MACH64) 94 95CONVLIBDIR = -L$(SGSHOME)/libconv/$(MACH) 96CONVLIBDIR64 = -L$(SGSHOME)/libconv/$(MACH64) 97 98ELFLIBDIR = -L$(SGSHOME)/libelf/$(MACH) 99ELFLIBDIR64 = -L$(SGSHOME)/libelf/$(MACH64) 100 101LDDBGLIBDIR = -L$(SGSHOME)/liblddbg/$(MACH) 102LDDBGLIBDIR64 = -L$(SGSHOME)/liblddbg/$(MACH64) 103 104 105# The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN. We don't need 106# this definition as the sgs utilities obtain their domain via sgsmsg(1l). 107 108DTEXTDOM = 109 110# Define any generic sgsmsg(1l) flags. The default message generation system 111# is to use gettext(3i), add the -C flag to switch to catgets(3c). 112 113SGSMSG = $(SGSTOOLS)/$(MACH)/sgsmsg 114SGSMSG_PIGLATIN_NL = perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl 115CHKMSG = $(SGSTOOLS)/chkmsg.sh 116 117SGSMSGVFLAG = 118SGSMSGFLAGS = $(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident 119CHKMSGFLAGS = $(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %) 120 121# Native targets should use the minimum of ld(1) flags to allow building on 122# previous releases. We use mapfiles to scope, but don't bother versioning. 123 124native := DYNFLAGS = -R$(SGSPROTO) -L$(SGSPROTO) $(ZNOVERSION) $(HSONAME) 125 126# Comment out the following two lines to have the sgs built from the system 127# link-editor, rather than the local proto link-editor. 128CC_USE_PROTO = -Yl,$(SGSPROTO) 129LD_USE_PROTO = $(SGSPROTO)/ 130 131# 132# lint-related stuff 133# 134LIBNAME32 = $(LIBNAME:%=%32) 135LIBNAME64 = $(LIBNAME:%=%64) 136LIBNAMES = $(LIBNAME32) $(LIBNAME64) 137 138SGSLINTOUT = lint.out 139LINTOUT1 = lint.out.1 140LINTOUT32 = lint.out.32 141LINTOUT64 = lint.out.64 142LINTOUTS = $(SGSLINTOUT) $(LINTOUT1) $(LINTOUT32) $(LINTOUT64) 143 144LINTLIBSRC = $(LINTLIB:%.ln=%) 145LINTLIB32 = $(LINTLIB:%.ln=%32.ln) 146LINTLIB64 = $(LINTLIB:%.ln=%64.ln) 147LINTLIBS = $(LINTLIB32) $(LINTLIB64) 148 149LINTFLAGS = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED 150LINTFLAGS64 = -m -errtags=yes -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED \ 151 $(VAR_LINTFLAGS64) 152 153# 154# When building a lint library, no other lint libraries are verified as 155# dependencies, nor is the stardard C lint library processed. All dependency 156# verification is carried out through linting the sources themselves. 157# 158$(LINTLIB) := LINTFLAGS += -n 159$(LINTLIB) := LINTFLAGS64 += -n 160 161$(LINTLIB32) := LINTFLAGS += -n 162$(LINTLIB32) := LINTFLAGS64 += -n 163$(LINTLIB64) := LINTFLAGS += -n 164$(LINTLIB64) := LINTFLAGS64 += -n 165 166# 167# These libraries have two resulting lint libraries. If a dependency is 168# declared using these variables, the substitution for the 32/64 versions at 169# lint time happens automatically (see Makefile.targ). 170# 171LD_LIB = -lld 172LD_LIB32 = -lld32 173LD_LIB64 = -lld64 174 175LDDBG_LIB = -llddbg 176LDDBG_LIB32 = -llddbg32 177LDDBG_LIB64 = -llddbg64 178 179CONV_LIB = -lconv 180CONV_LIB32 = -lconv32 181CONV_LIB64 = -lconv64 182