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