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