xref: /titanic_51/usr/src/tools/scripts/Makefile (revision 52ccf843e173e2a4a657360b0a22853fd413905f)
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	keywords \
46	makebfu \
47	mkacr \
48	mkbfu \
49	mkclosed \
50	nightly \
51	onblddrop \
52	protocmp.terse \
53	sccscheck \
54	sccscp \
55	sccshist \
56	sccsmv \
57	sccsrm \
58	sdrop \
59	webrev \
60	ws \
61	wx \
62	xref
63
64PERLFILES= \
65	cddlchk \
66	check_rtime \
67	hdrchk \
68	jstyle \
69	mkreadme_osol \
70	mktpl \
71	validate_flg \
72	validate_paths \
73	wdiff
74
75PYFILES= \
76	wsdiff
77
78MAN1FILES= \
79	Install.1 \
80	acr.1 \
81	bldenv.1 \
82	bringovercheck.1 \
83	cddlchk.1 \
84	checkpaths.1 \
85	check_rtime.1 \
86	cstyle.1 \
87	flg.flp.1 \
88	jstyle.1 \
89	mkacr.1 \
90	nightly.1 \
91	sccscheck.1 \
92	sccscp.1 \
93	sccsmv.1 \
94	sccsrm.1 \
95	webrev.1 \
96	ws.1 \
97	wsdiff.1 \
98	wx.1 \
99	xref.1
100
101MAKEFILES= \
102	xref.mk
103
104CLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1 cddlchk.1
105
106include ../Makefile.tools
107
108OWNER=		root
109GROUP=		bin
110$(ROOTONBLDMAN1FILES) := FILEMODE=	644
111$(ROOTONBLDMAKEFILES) := FILEMODE=	644
112
113.KEEP_STATE:
114
115all:	$(SHFILES) $(PERLFILES) $(PYFILES) $(MAN1FILES) $(MAKEFILES)
116
117install: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES) \
118		$(ROOTONBLDPYFILES) $(ROOTONBLDMAN1FILES) $(ROOTONBLDMAKEFILES)
119
120clean:
121	$(RM) $(CLEANFILES)
122
123bldenv: bldenv.sh stdenv.sh
124	$(RM) "$@"
125	sed -e '/# STDENV_START/ r stdenv.sh' bldenv.sh > "$@"
126	# Check for shell lint and fail if we hit warings
127	shlintout="$$( /usr/bin/ksh93 -n "$@" 2>&1 )" ; \
128		[[ "$${shlintout}" != "" ]] && \
129		{ print -r -- "$${shlintout}" ;	false ; } || true
130	$(CHMOD) +x "$@"
131
132bldenv.1: bldenv
133	$(RM) "$@"
134	(set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
135	sed 's/\.DS/.nf/g;s/\.DE/.fi/' > "$@"
136
137nightly: nightly.sh stdenv.sh
138	$(RM) "$@"
139	sed -e '/# STDENV_START/ r stdenv.sh' nightly.sh > nightly
140	$(CHMOD) +x "$@"
141
142cddlchk.1: cddlchk.pl
143	/usr/perl5/bin/pod2man --center='User Commands' --name=cddlchk \
144	--section=1 --release='SunOS $(RELEASE)' $? > "$@"
145
146include ../Makefile.targ
147
148