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