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