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