10080 smatch Makefile changes for usr/src/cmd

   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 2009 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #


  26 # Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  27 #
  28 # Copyright (c) 2018, Joyent, Inc.
  29 #
  30 
  31 PROG= alias
  32 ALIASPROG= \
  33         bg \
  34         cd \
  35         cksum \
  36         cmp \
  37         comm \
  38         command \
  39         cut \
  40         fc \
  41         fg \
  42         getopts \
  43         hash \
  44         jobs \
  45         join \
  46         kill \
  47         logname \
  48         paste \
  49         print \
  50         read \
  51         rev \
  52         sleep \
  53         sum \
  54         tee \
  55         test \
  56         type \
  57         ulimit \
  58         umask \
  59         unalias \
  60         uniq \
  61         wait \
  62         wc
  63 
  64 XPG4ALIASPROG= \
  65         alias \
  66         bg \
  67         cd \
  68         command \
  69         fc \
  70         fg \
  71         getopts \
  72         hash \
  73         jobs \
  74         kill \
  75         read \
  76         test \
  77         type \
  78         ulimit \
  79         umask \
  80         unalias \
  81         wait
  82 
  83 XPG4SH= \
  84         sh
  85 
  86 ROOTXPG4ALIAS= \
  87         $(XPG4SH:%=$(ROOTXPG4BIN)/%) $(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%)
  88 ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
  89 
  90 include ../../Makefile.cmd
  91 $(SPARC_BLD)include ../../Makefile.cmd.64
  92 
  93 FILEMODE= 555
  94 CERRWARN += -_gcc=-Wno-parentheses
  95 
  96 # not linted
  97 SMATCH=off
  98 
  99 .KEEP_STATE:
 100 
 101 all: $(PROG)
 102 
 103 $(XPG4ALIASPROG:%=$(ROOTXPG4BIN)/%):
 104         $(RM) $@; $(SYMLINK) ../../bin/alias $@
 105 
 106 $(XPG4SH:%=$(ROOTXPG4BIN)/%):
 107         $(RM) $@; $(SYMLINK) ../../bin/ksh93 $@
 108 
 109 $(ALIASPROG:%=$(ROOTBIN)/%): $(ROOTPROG)
 110         $(RM) $@; $(LN) $(ROOTPROG) $@
 111 
 112 .KEEP_STATE:
 113 
 114 # Set common AST build flags (e.g., needed to support the math stuff).
 115 include ../../../Makefile.ast
 116 
 117 OBJECTS= \
 118         alias.o
 119 
 120 SRCS=   $(OBJECTS:%.o=%.c)
 121 
 122 LDLIBS += -lshell -lcmd -last
 123 
 124 CPPFLAGS = \
 125         $(DTEXTDOM) $(DTS_ERRNO) \
 126         -I$(ROOT)/usr/include/ast \
 127         -I$(ROOT)/usr/include
 128 
 129 # Enable workaround for a crash in /usr/bin/alias when invalid
 130 # options are passed (e.g. $ /usr/bin/alias -c #). The shell
 131 # code will call an error handler which does a |longjmp()| but
 132 # somehow the code failed to do the |setjmp()| before this point.
 133 CPPFLAGS += -DWORKAROUND_FOR_ALIAS_CRASH
 134 
 135 CFLAGS += \
 136         $(ASTCFLAGS)
 137 CFLAGS64 += \
 138         $(ASTCFLAGS64)
 139 
 140 ROOTCMDDIR=$(ROOT)/usr/bin
 141 
 142 install: all $(ROOTPROG) $(ROOTXPG4PROG) $(ROOTALIASPROG) $(ROOTXPG4ALIAS)
 143 
 144 $(PROG):        $(OBJECTS)
 145         $(RM) alias
 146         $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
 147         $(POST_PROCESS)
 148 
 149 clean clobber:
 150         rm -f $(PROG) $(OBJECTS)
 151 
 152 lint _msg:
--- EOF ---