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 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  23 #
  24 # Copyright 2010, Richard Lowe
  25 
  26 SHELL=/usr/bin/ksh93
  27 
  28 SHFILES= \
  29         Install \
  30         bldenv \
  31         build_cscope \
  32         bringovercheck \
  33         checkpaths \
  34         checkproto \
  35         cstyle \
  36         elfcmp \
  37         flg.flp \
  38         genoffsets \
  39         hgsetup \
  40         nightly \
  41         onu \
  42         protocmp.terse \
  43         sccscheck \
  44         webrev \
  45         which_scm \
  46         ws \
  47         xref \
  48         zmake
  49 
  50 PERLFILES= \
  51         check_rtime \
  52         find_elf \
  53         interface_check \
  54         interface_cmp \
  55         jstyle \
  56         validate_flg \
  57         validate_paths \
  58         wdiff
  59 
  60 PERLMODULES= \
  61         onbld_elfmod.pm \
  62         onbld_elfmod_vertype.pm
  63 
  64 
  65 PYFILES= \
  66         cddlchk \
  67         copyrightchk \
  68         git-pbchk \
  69         hdrchk \
  70         hg-active \
  71         mapfilechk \
  72         validate_pkg \
  73         wsdiff
  74 
  75 SCRIPTLINKS= \
  76         git-nits
  77 
  78 MAN1FILES= \
  79         Install.1 \
  80         bldenv.1 \
  81         bringovercheck.1 \
  82         cddlchk.1 \
  83         checkpaths.1 \
  84         check_rtime.1 \
  85         cstyle.1 \
  86         find_elf.1 \
  87         flg.flp.1 \
  88         git-pbchk.1 \
  89         hdrchk.1 \
  90         interface_check.1 \
  91         interface_cmp.1 \
  92         hgsetup.1 \
  93         jstyle.1 \
  94         mapfilechk.1 \
  95         nightly.1 \
  96         onu.1 \
  97         sccscheck.1 \
  98         webrev.1 \
  99         which_scm.1 \
 100         ws.1 \
 101         wsdiff.1 \
 102         xref.1
 103 
 104 MAN1LINKS= \
 105         git-nits.1
 106 
 107 MAKEFILES= \
 108         xref.mk
 109 
 110 ETCFILES= \
 111         hgstyle \
 112         its.conf \
 113         its.reg
 114 
 115 EXCEPTFILES= \
 116         check_rtime \
 117         interface_check \
 118         interface_cmp
 119 
 120 CLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1
 121 
 122 include ../Makefile.tools
 123 
 124 ROOTONBLDSCRIPTLINKS = $(SCRIPTLINKS:%=$(ROOTONBLDBIN)/%)
 125 ROOTONBLDMAN1LINKS = $(MAN1LINKS:%=$(ROOTONBLDMAN1)/%)
 126 
 127 $(ROOTONBLDETCFILES)    := FILEMODE=    644
 128 $(ROOTONBLDEXCEPTFILES) := FILEMODE=    644
 129 $(ROOTONBLDPERLMODULES) := FILEMODE=    644
 130 $(ROOTONBLDMAKEFILES)   := FILEMODE=    644
 131 $(ROOTONBLDMAN1FILES)   := FILEMODE=    644
 132 
 133 .KEEP_STATE:
 134 
 135 all:    $(SHFILES) $(PERLFILES) $(PERLMODULES) $(PYFILES) \
 136         $(MAN1FILES) $(MAKEFILES)
 137 
 138 $(ROOTONBLDBIN)/git-nits:
 139         $(RM) $(ROOTONBLDBIN)/git-nits
 140         $(SYMLINK) git-pbchk $(ROOTONBLDBIN)/git-nits
 141 
 142 $(ROOTONBLDMAN1)/git-nits.1:
 143         $(RM) $(ROOTONBLDMAN1)/git-nits.1
 144         $(SYMLINK) git-pbchk.1 $(ROOTONBLDMAN1)/git-nits.1
 145 
 146 install: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES)    \
 147                 $(ROOTONBLDPERLMODULES) $(ROOTONBLDPYFILES)     \
 148                 $(ROOTONBLDSCRIPTLINKS) $(ROOTONBLDMAN1FILES)   \
 149                 $(ROOTONBLDMAKEFILES) $(ROOTONBLDETCFILES)      \
 150                 $(ROOTONBLDEXCEPTFILES) $(ROOTONBLDMAN1LINKS)
 151 
 152 clean:
 153         $(RM) $(CLEANFILES)
 154 
 155 bldenv: bldenv.sh stdenv.sh
 156         $(RM) "$@"
 157         sed -e '/# STDENV_START/ r stdenv.sh' bldenv.sh > "$@"
 158         # Check for shell lint and fail if we hit warnings
 159         shlintout="$$( /usr/bin/ksh93 -n "$@" 2>&1 )" ; \
 160                 [[ "$${shlintout}" != "" ]] && \
 161                 { print -r -- "$${shlintout}" ; false ; } || true
 162         $(CHMOD) +x "$@" 
 163 
 164 bldenv.1: bldenv
 165         $(RM) "$@"
 166         (set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
 167         sed 's/\.DS/.nf/g;s/\.DE/.fi/' > "$@"
 168 
 169 nightly: nightly.sh stdenv.sh
 170         $(RM) "$@"
 171         sed -e '/# STDENV_START/ r stdenv.sh' nightly.sh > nightly
 172         $(CHMOD) +x "$@" 
 173 
 174 include ../Makefile.targ
 175