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