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


   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) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  24 #

  25 
  26 SHELL=/usr/bin/ksh93
  27 
  28 PROG= ksh
  29 
  30 USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93
  31 
  32 OBJECTS= \
  33         pmain.o
  34 
  35 LIBSHELLBASE=../../../lib/libshell
  36 LIBSHELLSRC=$(LIBSHELLBASE)/common/sh
  37 
  38 SRCS=   $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
  39 
  40 LDLIBS += -lshell
  41 
  42 # Set common AST build flags (e.g., needed to support the math stuff).
  43 include ../../../Makefile.ast
  44 
  45 # 1. Make sure that the -D/-U defines in CFLAGS below are in sync
  46 # with usr/src/lib/libshell/Makefile.com
  47 # 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
  48 # case - it MUST come as the last element but future changes in -D options
  49 # may then cause silent breakage in the AST sources because the last -D
  50 # option specified overrides previous -D options so we prefer the current
  51 # way to explicitly list each single flag.
  52 CPPFLAGS = \
  53         $(DTEXTDOM) $(DTS_ERRNO) \
  54         $(LIBSHELLCPPFLAGS)
  55 
  56 CFLAGS += \
  57         $(ASTCFLAGS)
  58 CFLAGS64 += \
  59         $(ASTCFLAGS64)
  60 
  61 # Workaround for CR#6628728 ("|memcntl()| prototype not available for C99/XPG6")
  62 pmain.o := CERRWARN += -_gcc=-Wno-implicit-function-declaration
  63 pmain.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
  64 



  65 .KEEP_STATE:
  66 
  67 %.o:    $(LIBSHELLSRC)/%.c
  68         $(COMPILE.c) -c -o $@ $<
  69         $(POST_PROCESS_O)
  70 
  71 all:    $(PROG)
  72 
  73 # We explicitly delete "ksh" and "ksh93" to catch changes in
  74 # BUILD_KSH93_AS_BINKSH (see Makefile.ksh93switch)
  75 # and soft-link $(PROG) to ksh/ksh93 below because ksh93 test
  76 # suite seems to require that ksh93 is available as "ksh" in
  77 # ${PATH} (see comment about "io.sh" in Makefile.testshell).
  78 $(PROG):        $(OBJECTS)
  79         $(RM) ksh ksh93
  80         $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
  81         $(POST_PROCESS)
  82         (set +o errexit ; \
  83         [[ ! -x ksh93 ]] && ln $(PROG) ksh93 ; \
  84         [[ ! -x ksh   ]] && ln $(PROG) ksh   ; \




   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) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  24 #
  25 # Copyright (c) 2018, Joyent, Inc.
  26 
  27 SHELL=/usr/bin/ksh93
  28 
  29 PROG= ksh
  30 
  31 USRKSH_ALIAS_LIST=ksh ksh93 rksh rksh93
  32 
  33 OBJECTS= \
  34         pmain.o
  35 
  36 LIBSHELLBASE=../../../lib/libshell
  37 LIBSHELLSRC=$(LIBSHELLBASE)/common/sh
  38 
  39 SRCS=   $(OBJECTS:%.o=$(LIBSHELLSRC)/%.c)
  40 
  41 LDLIBS += -lshell
  42 
  43 # Set common AST build flags (e.g., needed to support the math stuff).
  44 include ../../../Makefile.ast
  45 
  46 # 1. Make sure that the -D/-U defines in CFLAGS below are in sync
  47 # with usr/src/lib/libshell/Makefile.com
  48 # 2. We use "=" here since using $(CPPFLAGS.master) is very tricky in our
  49 # case - it MUST come as the last element but future changes in -D options
  50 # may then cause silent breakage in the AST sources because the last -D
  51 # option specified overrides previous -D options so we prefer the current
  52 # way to explicitly list each single flag.
  53 CPPFLAGS = \
  54         $(DTEXTDOM) $(DTS_ERRNO) \
  55         $(LIBSHELLCPPFLAGS)
  56 
  57 CFLAGS += \
  58         $(ASTCFLAGS)
  59 CFLAGS64 += \
  60         $(ASTCFLAGS64)
  61 
  62 # Workaround for CR#6628728 ("|memcntl()| prototype not available for C99/XPG6")
  63 pmain.o := CERRWARN += -_gcc=-Wno-implicit-function-declaration
  64 pmain.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
  65 
  66 # not linted
  67 SMATCH=off
  68 
  69 .KEEP_STATE:
  70 
  71 %.o:    $(LIBSHELLSRC)/%.c
  72         $(COMPILE.c) -c -o $@ $<
  73         $(POST_PROCESS_O)
  74 
  75 all:    $(PROG)
  76 
  77 # We explicitly delete "ksh" and "ksh93" to catch changes in
  78 # BUILD_KSH93_AS_BINKSH (see Makefile.ksh93switch)
  79 # and soft-link $(PROG) to ksh/ksh93 below because ksh93 test
  80 # suite seems to require that ksh93 is available as "ksh" in
  81 # ${PATH} (see comment about "io.sh" in Makefile.testshell).
  82 $(PROG):        $(OBJECTS)
  83         $(RM) ksh ksh93
  84         $(LINK.c) $(OBJECTS) -o $@ $(LDLIBS)
  85         $(POST_PROCESS)
  86         (set +o errexit ; \
  87         [[ ! -x ksh93 ]] && ln $(PROG) ksh93 ; \
  88         [[ ! -x ksh   ]] && ln $(PROG) ksh   ; \