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 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  22 # Use is subject to license terms.
  23 #
  24 # Copyright (c) 2018, Joyent, Inc.
  25 #
  26 # common rules for $SRC/cmd/fwflash
  27 
  28 CLOSED=                 $(SRC)/../closed
  29 
  30 CERRWARN +=             -_gcc=-Wno-parentheses
  31 CERRWARN +=             -_gcc=-Wno-uninitialized
  32 CERRWARN +=             -_gcc=-Wno-address
  33 
  34 # not linted
  35 SMATCH=off
  36 
  37 ROOTUSR=                $(ROOT)/usr
  38 ROOTUSRINCLD=           $(ROOTUSR)/include
  39 ROOTUSRINCLDFWFLASH=    $(ROOTUSRINCLD)/fwflash
  40 ROOTUSRLIB=             $(ROOTUSR)/lib
  41 ROOTUSRLIBFWFLASH=      $(ROOTUSRLIB)/fwflash
  42 ROOTUSRLIBFWFLASHIDF=   $(ROOTUSRLIBFWFLASH)/identify
  43 ROOTUSRLIBFWFLASHVRF=   $(ROOTUSRLIBFWFLASH)/verify
  44 ROOTUSRSBIN=            $(ROOTUSR)/sbin
  45 
  46 $(ROOTUSR):
  47         $(INS.dir)
  48 
  49 $(ROOTUSRINCLD):        $(ROOTUSR)
  50         $(INS.dir)
  51 
  52 $(ROOTUSRINCLDFWFLASH):
  53         $(INS.dir)
  54 
  55 $(ROOTUSRINCLDFWFLASH)/%: $(ROOTUSRINCLDFWFLASH) %
  56         $(INS.file)
  57 
  58 $(ROOTUSRLIB):
  59         $(INS.dir)
  60 
  61 $(ROOTUSRLIBFWFLASH):   $(ROOTUSRLIB)
  62         $(INS.dir)
  63 
  64 $(ROOTUSRLIBFWFLASH)/%: $(ROOTUSRLIB) %
  65         $(INS.dir)
  66 
  67 $(ROOTUSRLIBFWFLASHIDF): $(ROOTUSRLIBFWFLASH)
  68         $(INS.dir)
  69 
  70 $(ROOTUSRLIBFWFLASHIDF)/%: $(ROOTUSRLIBFWFLASHIDF) %
  71         $(INS.file)
  72 
  73 $(ROOTUSRLIBFWFLASHVRF): $(ROOTUSRLIBFWFLASH)
  74         $(INS.dir)
  75 
  76 $(ROOTUSRLIBFWFLASHVRF)/%: $(ROOTUSRLIBFWFLASHVRF) %
  77         $(INS.file)
  78 
  79 $(ROOTUSRSBIN):         $(ROOTUSR)
  80         $(INS.dir)
  81 
  82 $(ROOTUSRSBIN)/%:       %
  83         $(INS.file)
  84 
  85 
  86 
  87 %.ln: $(SRCDIR)/%.c
  88         $(LINT.c) $(LINTFLAGS) -c $<
  89 
  90 %.po: $(SRCDIR)/%.c
  91         $(RM) messages.po
  92         $(XGETTEXT) $(XGETFLAGS) \
  93             `($(GREP) -l gettext $< || echo /dev/null)`
  94         $(SED) "/^domain/d" messages.po > $@
  95         $(RM) messages.po
  96 
  97 $(POFILE): $(POFILES)
  98         $(RM) $@
  99         cat $(POFILES) >$@           
 100 
 101 LINTFLAGS += -D_POSIX_PTHREAD_SEMANTICS -erroff=E_CONSTANT_CONDITION \
 102         -erroff=E_SUPPRESSION_DIRECTIVE_UNUSED