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