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 
  32 include         $(SRC)/cmd/sgs/Makefile.var
  33 
  34 i386_ARCH =     intel
  35 sparc_ARCH =    sparc
  36 
  37 ARCH =          $($(MACH)_ARCH)
  38 
  39 # Establish any global flags.
  40 
  41 # Setting DEBUG = -DDEBUG (or "make DEBUG=-DDEBUG ...") enables ASSERT()
  42 # checking.  This is automatically enabled for DEBUG builds, not for non-debug
  43 # builds.  Unset the global CSTD_GNU89 flag to insure we uncover all compiler
  44 # warnings/errors.
  45 DEBUG =
  46 $(NOT_RELEASE_BUILD)DEBUG = -DDEBUG
  47 
  48 CSTD_GNU89 =    $(CSTD_GNU99)
  49 
  50 CFLAGS +=       $(CCVERBOSE) $(DEBUG) $(XFFLAG)
  51 CFLAGS64 +=     $(CCVERBOSE) $(DEBUG) $(XFFLAG)
  52 
  53 NATIVE_CFLAGS +=        $(CCVERBOSE) $(DEBUG) $(XFFLAG)
  54 
  55 CERRWARN +=     -_gcc=-Wno-type-limits
  56 CERRWARN +=     -_gcc=-Wno-parentheses
  57 CERRWARN +=     -_gcc=-Wno-unused-value
  58 
  59 #
  60 # Location of the shared elfcap code
  61 #
  62 ELFCAP=         $(SRC)/common/elfcap
  63 
  64 # Reassign CPPFLAGS so that local search paths are used before any parent
  65 # $ROOT paths.
  66 CPPFLAGS =      -I. -I../common -I$(SGSHOME)/include -I$(SGSHOME)/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 
  74 LDFLAGS +=      $(ZIGNORE)
  75 DYNFLAGS +=     $(ZIGNORE)
  76 
  77 # Establish the local tools, proto and package area.
  78 
  79 SGSHOME =       $(SRC)/cmd/sgs
  80 SGSCOMMON =     $(SGSHOME)/common
  81 SGSTOOLS =      $(SGSHOME)/tools
  82 SGSMSGID =      $(SGSHOME)/messages
  83 SGSMSGDIR =     $(SGSHOME)/messages/$(MACH)
  84 SGSONLD =       $(ROOT)/opt/SUNWonld
  85 SGSRPATH =      /usr/lib
  86 SGSRPATH64 =    $(SGSRPATH)/$(MACH64)
  87 
  88 #
  89 # Macros to be used to include link against libconv and include vernote.o
  90 #
  91 VERSREF =       -ulink_ver_string
  92 
  93 LDLIBDIR =      -L$(SGSHOME)/libld/$(MACH)
  94 LDLIBDIR64 =    -L$(SGSHOME)/libld/$(MACH64)
  95 
  96 CONVLIBDIR =    -L$(SGSHOME)/libconv/$(MACH)
  97 CONVLIBDIR64 =  -L$(SGSHOME)/libconv/$(MACH64)
  98 
  99 ELFLIBDIR =     -L$(SGSHOME)/libelf/$(MACH)
 100 ELFLIBDIR64 =   -L$(SGSHOME)/libelf/$(MACH64)
 101 
 102 LDDBGLIBDIR =   -L$(SGSHOME)/liblddbg/$(MACH)
 103 LDDBGLIBDIR64 = -L$(SGSHOME)/liblddbg/$(MACH64)
 104 
 105 
 106 # The cmd/Makefile.com and lib/Makefile.com define TEXT_DOMAIN.  We don't need
 107 # this definition as the sgs utilities obtain their domain via sgsmsg(1l).
 108 
 109 DTEXTDOM =
 110 
 111 # Define any generic sgsmsg(1l) flags.  The default message generation system
 112 # is to use gettext(3i), add the -C flag to switch to catgets(3c).
 113 
 114 SGSMSG =                $(ONBLD_TOOLS)/bin/$(MACH)/sgsmsg
 115 SGSMSG_PIGLATIN_NL =    perl $(SGSTOOLS)/common/sgsmsg_piglatin_nl.pl
 116 CHKMSG =                $(SGSHOME)/tools/chkmsg.sh
 117 
 118 SGSMSGVFLAG =
 119 SGSMSGFLAGS =   $(SGSMSGVFLAG) -i $(SGSMSGID)/sgs.ident
 120 CHKMSGFLAGS =   $(SGSMSGTARG:%=-m %) $(SGSMSGCHK:%=-m %)