xref: /titanic_41/usr/src/tools/scripts/Makefile (revision 4e0638098cbd112e68bbd287fa0d956d72ee1151)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
578fe7221Sdduvall# Common Development and Distribution License (the "License").
678fe7221Sdduvall# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22b83ec4edSjmcp# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
237c478bd9Sstevel@tonic-gate#
242f54b716SRichard Lowe# Copyright 2010, Richard Lowe
257c478bd9Sstevel@tonic-gate
2663df1173SpetedeSHELL=/usr/bin/ksh93
2763df1173Spetede
287c478bd9Sstevel@tonic-gateSHFILES= \
297c478bd9Sstevel@tonic-gate	Install \
307c478bd9Sstevel@tonic-gate	bldenv \
317c478bd9Sstevel@tonic-gate	build_cscope \
32733ed737Ssommerfe	bringovercheck \
337c478bd9Sstevel@tonic-gate	checkpaths \
347c478bd9Sstevel@tonic-gate	checkproto \
357c478bd9Sstevel@tonic-gate	cstyle \
367c478bd9Sstevel@tonic-gate	elfcmp \
377c478bd9Sstevel@tonic-gate	flg.flp \
387c478bd9Sstevel@tonic-gate	genoffsets \
39cdf0c1d5Smjnelson	hgsetup \
407c478bd9Sstevel@tonic-gate	nightly \
41ead1f93eSLiane Praza	onu \
427c478bd9Sstevel@tonic-gate	protocmp.terse \
43733ed737Ssommerfe	sccscheck \
447c478bd9Sstevel@tonic-gate	webrev \
45cdf0c1d5Smjnelson	which_scm \
467c478bd9Sstevel@tonic-gate	ws \
477c478bd9Sstevel@tonic-gate	xref
487c478bd9Sstevel@tonic-gate
497c478bd9Sstevel@tonic-gatePERLFILES= \
507c478bd9Sstevel@tonic-gate	check_rtime \
5175ce41a5SAli Bahrami	find_elf \
5275ce41a5SAli Bahrami	interface_check \
5375ce41a5SAli Bahrami	interface_cmp \
5478fe7221Sdduvall	jstyle \
557c478bd9Sstevel@tonic-gate	validate_flg \
567c478bd9Sstevel@tonic-gate	validate_paths \
577c478bd9Sstevel@tonic-gate	wdiff
587c478bd9Sstevel@tonic-gate
5975ce41a5SAli BahramiPERLMODULES= \
605253169eSAli Bahrami	onbld_elfmod.pm \
615253169eSAli Bahrami	onbld_elfmod_vertype.pm
6275ce41a5SAli Bahrami
6375ce41a5SAli Bahrami
6496ccc8cbSesaxePYFILES= \
65cdf0c1d5Smjnelson	cddlchk \
66cdf0c1d5Smjnelson	copyrightchk \
67*8bcea973SRichard Lowe	git-pbchk \
68cdf0c1d5Smjnelson	hdrchk \
69cdf0c1d5Smjnelson	hg-active \
70bfed486aSAli Bahrami	mapfilechk \
71ead1f93eSLiane Praza	validate_pkg \
7296ccc8cbSesaxe	wsdiff
7396ccc8cbSesaxe
74*8bcea973SRichard LoweSCRIPTLINKS= \
75*8bcea973SRichard Lowe	git-nits
76*8bcea973SRichard Lowe
777c478bd9Sstevel@tonic-gateMAN1FILES= \
787c478bd9Sstevel@tonic-gate	Install.1 \
797c478bd9Sstevel@tonic-gate	bldenv.1 \
80733ed737Ssommerfe	bringovercheck.1 \
811f1defa1Salanbur	cddlchk.1 \
827c478bd9Sstevel@tonic-gate	checkpaths.1 \
837c478bd9Sstevel@tonic-gate	check_rtime.1 \
847c478bd9Sstevel@tonic-gate	cstyle.1 \
8575ce41a5SAli Bahrami	find_elf.1 \
867c478bd9Sstevel@tonic-gate	flg.flp.1 \
87*8bcea973SRichard Lowe	git-pbchk.1 \
88cdf0c1d5Smjnelson	hdrchk.1 \
8975ce41a5SAli Bahrami	interface_check.1 \
9075ce41a5SAli Bahrami	interface_cmp.1 \
91cdf0c1d5Smjnelson	hgsetup.1 \
9278fe7221Sdduvall	jstyle.1 \
93bfed486aSAli Bahrami	mapfilechk.1 \
947c478bd9Sstevel@tonic-gate	nightly.1 \
95ead1f93eSLiane Praza	onu.1 \
96733ed737Ssommerfe	sccscheck.1 \
977c478bd9Sstevel@tonic-gate	webrev.1 \
98cdf0c1d5Smjnelson	which_scm.1 \
997c478bd9Sstevel@tonic-gate	ws.1 \
10096ccc8cbSesaxe	wsdiff.1 \
1017c478bd9Sstevel@tonic-gate	xref.1
1027c478bd9Sstevel@tonic-gate
103*8bcea973SRichard LoweMAN1LINKS= \
104*8bcea973SRichard Lowe	git-nits.1
105*8bcea973SRichard Lowe
1067c478bd9Sstevel@tonic-gateMAKEFILES= \
1077c478bd9Sstevel@tonic-gate	xref.mk
1087c478bd9Sstevel@tonic-gate
10993af10a4SMark J. NelsonETCFILES= \
1100fd2682eSMark J. Nelson	hgstyle \
1110fd2682eSMark J. Nelson	its.conf \
1120fd2682eSMark J. Nelson	its.reg
11393af10a4SMark J. Nelson
11475ce41a5SAli BahramiEXCEPTFILES= \
11575ce41a5SAli Bahrami	check_rtime \
11675ce41a5SAli Bahrami	interface_check \
11775ce41a5SAli Bahrami	interface_cmp
11875ce41a5SAli Bahrami
119cdf0c1d5SmjnelsonCLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gateinclude ../Makefile.tools
1227c478bd9Sstevel@tonic-gate
123*8bcea973SRichard LoweROOTONBLDSCRIPTLINKS = $(SCRIPTLINKS:%=$(ROOTONBLDBIN)/%)
124*8bcea973SRichard LoweROOTONBLDMAN1LINKS = $(MAN1LINKS:%=$(ROOTONBLDMAN1)/%)
12593af10a4SMark J. Nelson
12693af10a4SMark J. Nelson$(ROOTONBLDETCFILES)	:= FILEMODE=	644
12775ce41a5SAli Bahrami$(ROOTONBLDEXCEPTFILES)	:= FILEMODE=	644
12875ce41a5SAli Bahrami$(ROOTONBLDPERLMODULES)	:= FILEMODE=	644
1297c478bd9Sstevel@tonic-gate$(ROOTONBLDMAKEFILES)	:= FILEMODE=	644
13093af10a4SMark J. Nelson$(ROOTONBLDMAN1FILES)	:= FILEMODE=	644
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate.KEEP_STATE:
1337c478bd9Sstevel@tonic-gate
13475ce41a5SAli Bahramiall:	$(SHFILES) $(PERLFILES) $(PERLMODULES) $(PYFILES) \
13575ce41a5SAli Bahrami	$(MAN1FILES) $(MAKEFILES)
1367c478bd9Sstevel@tonic-gate
137*8bcea973SRichard Lowe$(ROOTONBLDBIN)/git-nits:
138*8bcea973SRichard Lowe	$(RM) $(ROOTONBLDBIN)/git-nits
139*8bcea973SRichard Lowe	$(SYMLINK) git-pbchk $(ROOTONBLDBIN)/git-nits
140*8bcea973SRichard Lowe
141*8bcea973SRichard Lowe$(ROOTONBLDMAN1)/git-nits.1:
142*8bcea973SRichard Lowe	$(RM) $(ROOTONBLDMAN1)/git-nits.1
143*8bcea973SRichard Lowe	$(SYMLINK) git-pbchk.1 $(ROOTONBLDMAN1)/git-nits.1
144*8bcea973SRichard Lowe
1457c478bd9Sstevel@tonic-gateinstall: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES)	\
14675ce41a5SAli Bahrami		$(ROOTONBLDPERLMODULES) $(ROOTONBLDPYFILES)	\
147*8bcea973SRichard Lowe		$(ROOTONBLDSCRIPTLINKS) $(ROOTONBLDMAN1FILES)	\
148*8bcea973SRichard Lowe		$(ROOTONBLDMAKEFILES) $(ROOTONBLDETCFILES)	\
149*8bcea973SRichard Lowe		$(ROOTONBLDEXCEPTFILES) $(ROOTONBLDMAN1LINKS)
1507c478bd9Sstevel@tonic-gate
1517c478bd9Sstevel@tonic-gateclean:
1527c478bd9Sstevel@tonic-gate	$(RM) $(CLEANFILES)
1537c478bd9Sstevel@tonic-gate
1541fe69678Skupferbldenv: bldenv.sh stdenv.sh
15563df1173Spetede	$(RM) "$@"
15663df1173Spetede	sed -e '/# STDENV_START/ r stdenv.sh' bldenv.sh > "$@"
1572f54b716SRichard Lowe	# Check for shell lint and fail if we hit warnings
15863df1173Spetede	shlintout="$$( /usr/bin/ksh93 -n "$@" 2>&1 )" ; \
15963df1173Spetede		[[ "$${shlintout}" != "" ]] && \
16063df1173Spetede		{ print -r -- "$${shlintout}" ;	false ; } || true
16163df1173Spetede	$(CHMOD) +x "$@"
16263df1173Spetede
16363df1173Spetedebldenv.1: bldenv
16463df1173Spetede	$(RM) "$@"
16563df1173Spetede	(set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
16663df1173Spetede	sed 's/\.DS/.nf/g;s/\.DE/.fi/' > "$@"
1671fe69678Skupfer
1681fe69678Skupfernightly: nightly.sh stdenv.sh
16963df1173Spetede	$(RM) "$@"
1701fe69678Skupfer	sed -e '/# STDENV_START/ r stdenv.sh' nightly.sh > nightly
17163df1173Spetede	$(CHMOD) +x "$@"
1721fe69678Skupfer
1737c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
1747c478bd9Sstevel@tonic-gate
175