xref: /titanic_41/usr/src/tools/scripts/Makefile (revision cde2885fdf538266ee2a3b08dee2d5075ce8fa2b)
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 2009 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	mapfilechk \
80	rtichk \
81	wsdiff
82
83MAN1FILES= \
84	Install.1 \
85	acr.1 \
86	bldenv.1 \
87	bringovercheck.1 \
88	cddlchk.1 \
89	checkpaths.1 \
90	check_rtime.1 \
91	cstyle.1 \
92	flg.flp.1 \
93	hdrchk.1 \
94	hgsetup.1 \
95	jstyle.1 \
96	mapfilechk.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
114ETCFILES= \
115	hgstyle \
116	its.conf \
117	its.reg
118
119CLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1
120
121include ../Makefile.tools
122
123OWNER=		root
124GROUP=		bin
125
126$(ROOTONBLDETCFILES)	:= FILEMODE=	644
127$(ROOTONBLDMAKEFILES)	:= FILEMODE=	644
128$(ROOTONBLDMAN1FILES)	:= FILEMODE=	644
129
130.KEEP_STATE:
131
132all:	$(SHFILES) $(PERLFILES) $(PYFILES) $(MAN1FILES) $(MAKEFILES)
133
134install: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES)	\
135		$(ROOTONBLDPYFILES) $(ROOTONBLDMAN1FILES)	\
136		$(ROOTONBLDMAKEFILES) $(ROOTONBLDETCFILES)
137
138clean:
139	$(RM) $(CLEANFILES)
140
141bldenv: bldenv.sh stdenv.sh
142	$(RM) "$@"
143	sed -e '/# STDENV_START/ r stdenv.sh' bldenv.sh > "$@"
144	# Check for shell lint and fail if we hit warings
145	shlintout="$$( /usr/bin/ksh93 -n "$@" 2>&1 )" ; \
146		[[ "$${shlintout}" != "" ]] && \
147		{ print -r -- "$${shlintout}" ;	false ; } || true
148	$(CHMOD) +x "$@"
149
150bldenv.1: bldenv
151	$(RM) "$@"
152	(set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
153	sed 's/\.DS/.nf/g;s/\.DE/.fi/' > "$@"
154
155nightly: nightly.sh stdenv.sh
156	$(RM) "$@"
157	sed -e '/# STDENV_START/ r stdenv.sh' nightly.sh > nightly
158	$(CHMOD) +x "$@"
159
160include ../Makefile.targ
161
162