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 2014 Gary Mills
  24 #
  25 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  26 # Use is subject to license terms.
  27 #
  28 
  29 SHELL=/usr/bin/ksh93
  30 
  31 LIBRARY=        libsum.a
  32 VERS=           .1
  33 
  34 OBJECTS= \
  35         sumlib.o
  36 
  37 include ../../Makefile.astmsg
  38 
  39 include ../../Makefile.lib
  40 
  41 # mapfile-vers does not live with the sources in in common/ to make
  42 # automated code updates easier.
  43 MAPFILES=       ../mapfile-vers
  44 
  45 # Set common AST build flags (e.g. C99/XPG6, needed to support the math stuff)
  46 include ../../../Makefile.ast
  47 
  48 LIBS =          $(DYNLIB) $(LINTLIB)
  49 
  50 LDLIBS += \
  51                 -last \
  52                 -lmd \
  53                 -lc
  54 
  55 $(LINTLIB) :=   SRCS = $(SRCDIR)/$(LINTSRC)
  56 
  57 SRCDIR =        ../common
  58 
  59 # We use "=" here since using $(CPPFLAGS.master) is very tricky in our
  60 # case - it MUST come as the last element but future changes in -D options
  61 # may then cause silent breakage in the AST sources because the last -D
  62 # option specified overrides previous -D options so we prefer the current
  63 # way to explicitly list each single flag.
  64 # Notes:
  65 #   - "-D_BLD_DLL" comes from ${mam_cc_DLL} in Mamfile
  66 CPPFLAGS = \
  67         $(DTEXTDOM) $(DTS_ERRNO) \
  68         -Isrc/lib/libsum \
  69         -I$(ROOT)/usr/include/ast \
  70         -I$(ROOT)/usr/include \
  71         -D_PACKAGE_ast \
  72         -D_BLD_DLL
  73 
  74 CFLAGS += \
  75         $(ASTCFLAGS)
  76 CFLAGS64 += \
  77         $(ASTCFLAGS64)
  78 
  79 CERRWARN        += -_gcc=-Wno-parentheses
  80 
  81 # This codepath is performance-critical
  82 sparc_COPTFLAG=-_cc=-xO5 -_gcc=-O2 -_cc=-xprefetch=auto,explicit
  83 sparcv9_COPTFLAG=-_cc=-xO5 -_gcc=-O2 -_cc=-xprefetch=auto,explicit
  84 # No optimization for gcc
  85 i386_COPTFLAG=-_cc=-xO5 -_gcc=-O0 -_cc=-xprefetch=auto,explicit
  86 amd64_COPTFLAG=-_cc=-xO5 -_gcc=-O0  -_cc=-xprefetch=auto,explicit
  87 amd64_ADJCOPT=$(ADJUST_OPT1)
  88 
  89 # Suppress this one warning as the fix would break old gcc, which upstream
  90 # still supports. This needs a better fix (later).
  91 pics/sumlib.o   := CERRWARN += -erroff=E_CONST_PROMOTED_UNSIGNED_LONG
  92 
  93 .KEEP_STATE:
  94 
  95 all: $(LIBS)
  96 
  97 #
  98 # libsum is not lint-clean yet; fake up a target.  (You can use
  99 # "make lintcheck" to actually run lint; please send all lint fixes
 100 # upstream (to AT&T) so the next update will pull them into ON.)
 101 #
 102 lint:
 103         @ print "usr/src/lib/libsum is not lint-clean: skipping"
 104 
 105 include ../../Makefile.targ