Print this page
10080 smatch Makefile changes for usr/src/cmd


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

  26 
  27 include $(SRC)/cmd/Makefile.cmd
  28 
  29 .KEEP_STATE:
  30 
  31 ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
  32 ROOTTST = $(ROOTOPTPKG)/tst
  33 SUBDIR :sh= basename `pwd`
  34 TSTDIR = $(ROOTTST)/$(SUBDIR)
  35 DSTYLE = $(ROOTOPTPKG)/bin/dstyle
  36 
  37 CSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3-
  38 SSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3-
  39 DSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3-
  40 
  41 TSTS :sh= find . -name tst.*.d -o -name err.*.d -o \
  42         -name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \
  43         -o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d \
  44         -o -name get.*.pl
  45 


  49 EXES += $(SSRCS:%.s=%.exe)
  50 
  51 ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
  52 ROOT_EXES = $(EXES:%=$(TSTDIR)/%)
  53 
  54 $(ROOT_TSTS) := FILEMODE = 0444
  55 $(ROOT_EXES) := FILEMODE = 0555
  56 
  57 # The DTrace tests rely on "normal" behaviour from the compiler which
  58 # agressive optimization of small, simple, one compilation-unit programs may
  59 # utterly subvert.  We force the compiler to not optimize rather than engage
  60 # in an arms race with increasingly belligerent optimizers.
  61 COPTFLAG=       -xO0
  62 
  63 CERRWARN +=     -_gcc=-Wno-switch
  64 CERRWARN +=     -_gcc=-Wno-unused-variable
  65 CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  66 CERRWARN +=     -_gcc=-Wno-unused-function
  67 CERRWARN +=     -_gcc=-Wno-unused-variable
  68 



  69 all: $(EXES)
  70 
  71 clean lint:
  72 
  73 clobber: FRC
  74         -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
  75         -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
  76         -$(RM) $(DSRCS:%.d=%.o)
  77         -$(RM) $(CLOBBERFILES)
  78 
  79 install: $(ROOT_TSTS) $(ROOT_EXES)
  80 
  81 $(ROOT_TSTS): $(TSTDIR)
  82 
  83 $(ROOT_EXES): $(TSTDIR)
  84 
  85 $(TSTDIR):
  86         $(INS.dir)
  87 
  88 $(TSTDIR)/%: %




   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 2008 Sun Microsystems, Inc.  All rights reserved.
  24 # Use is subject to license terms.
  25 #
  26 # Copyright (c) 2018, Joyent, Inc.
  27 
  28 include $(SRC)/cmd/Makefile.cmd
  29 
  30 .KEEP_STATE:
  31 
  32 ROOTOPTPKG = $(ROOT)/opt/SUNWdtrt
  33 ROOTTST = $(ROOTOPTPKG)/tst
  34 SUBDIR :sh= basename `pwd`
  35 TSTDIR = $(ROOTTST)/$(SUBDIR)
  36 DSTYLE = $(ROOTOPTPKG)/bin/dstyle
  37 
  38 CSRCS :sh= find . -name SCCS -prune -o -name *.c -print | cut -b3-
  39 SSRCS :sh= find . -name SCCS -prune -o -name *.s -print | cut -b3-
  40 DSRCS :sh= find . -name SCCS -prune -o -name *.d -print | cut -b3-
  41 
  42 TSTS :sh= find . -name tst.*.d -o -name err.*.d -o \
  43         -name tst.*.d.out -o -name err.*.d.out -o -name tst.*.ksh \
  44         -o -name err.*.ksh -o -name tst.*.ksh.out -o -name drp.*.d \
  45         -o -name get.*.pl
  46 


  50 EXES += $(SSRCS:%.s=%.exe)
  51 
  52 ROOT_TSTS = $(TSTS:%=$(TSTDIR)/%)
  53 ROOT_EXES = $(EXES:%=$(TSTDIR)/%)
  54 
  55 $(ROOT_TSTS) := FILEMODE = 0444
  56 $(ROOT_EXES) := FILEMODE = 0555
  57 
  58 # The DTrace tests rely on "normal" behaviour from the compiler which
  59 # agressive optimization of small, simple, one compilation-unit programs may
  60 # utterly subvert.  We force the compiler to not optimize rather than engage
  61 # in an arms race with increasingly belligerent optimizers.
  62 COPTFLAG=       -xO0
  63 
  64 CERRWARN +=     -_gcc=-Wno-switch
  65 CERRWARN +=     -_gcc=-Wno-unused-variable
  66 CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  67 CERRWARN +=     -_gcc=-Wno-unused-function
  68 CERRWARN +=     -_gcc=-Wno-unused-variable
  69 
  70 # not linted
  71 SMATCH=off
  72 
  73 all: $(EXES)
  74 
  75 clean lint:
  76 
  77 clobber: FRC
  78         -$(RM) $(CSRCS:%.c=%.exe) $(CSRCS:%.c=%.o)
  79         -$(RM) $(SSRCS:%.s=%.exe) $(SSRCS:%.s=%.o)
  80         -$(RM) $(DSRCS:%.d=%.o)
  81         -$(RM) $(CLOBBERFILES)
  82 
  83 install: $(ROOT_TSTS) $(ROOT_EXES)
  84 
  85 $(ROOT_TSTS): $(TSTDIR)
  86 
  87 $(ROOT_EXES): $(TSTDIR)
  88 
  89 $(TSTDIR):
  90         $(INS.dir)
  91 
  92 $(TSTDIR)/%: %