xref: /titanic_52/usr/src/tools/scripts/Makefile (revision 721fffe35d40e548a5a58dc53a2ec9c6762172d9)
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 2010 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	cryptodrop \
40	cstyle \
41	elfcmp \
42	flg.flp \
43	genoffsets \
44	hgsetup \
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	which_scm \
61	ws \
62	wx \
63	wx2hg \
64	xref
65
66PERLFILES= \
67	check_rtime \
68	find_elf \
69	interface_check \
70	interface_cmp \
71	jstyle \
72	mkreadme_osol \
73	mktpl \
74	validate_flg \
75	validate_paths \
76	wdiff
77
78PERLMODULES= \
79	onbld_elfmod.pm
80
81
82PYFILES= \
83	cddlchk \
84	copyrightchk \
85	hdrchk \
86	hg-active \
87	mapfilechk \
88	rtichk \
89	wsdiff
90
91MAN1FILES= \
92	Install.1 \
93	acr.1 \
94	bldenv.1 \
95	bringovercheck.1 \
96	cddlchk.1 \
97	checkpaths.1 \
98	check_rtime.1 \
99	cstyle.1 \
100	find_elf.1 \
101	flg.flp.1 \
102	hdrchk.1 \
103	interface_check.1 \
104	interface_cmp.1 \
105	hgsetup.1 \
106	jstyle.1 \
107	mapfilechk.1 \
108	mkacr.1 \
109	nightly.1 \
110	sccscheck.1 \
111	sccscp.1 \
112	sccsmv.1 \
113	sccsrm.1 \
114	webrev.1 \
115	which_scm.1 \
116	ws.1 \
117	wsdiff.1 \
118	wx.1 \
119	wx2hg.1 \
120	xref.1
121
122MAKEFILES= \
123	xref.mk
124
125ETCFILES= \
126	hgstyle \
127	its.conf \
128	its.reg
129
130EXCEPTFILES= \
131	check_rtime \
132	interface_check \
133	interface_cmp
134
135CLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1
136
137include ../Makefile.tools
138
139
140$(ROOTONBLDETCFILES)	:= FILEMODE=	644
141$(ROOTONBLDEXCEPTFILES)	:= FILEMODE=	644
142$(ROOTONBLDPERLMODULES)	:= FILEMODE=	644
143$(ROOTONBLDMAKEFILES)	:= FILEMODE=	644
144$(ROOTONBLDMAN1FILES)	:= FILEMODE=	644
145
146.KEEP_STATE:
147
148all:	$(SHFILES) $(PERLFILES) $(PERLMODULES) $(PYFILES) \
149	$(MAN1FILES) $(MAKEFILES)
150
151install: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES)	\
152		$(ROOTONBLDPERLMODULES) $(ROOTONBLDPYFILES)	\
153		$(ROOTONBLDMAN1FILES) $(ROOTONBLDMAKEFILES)	\
154		$(ROOTONBLDETCFILES) $(ROOTONBLDEXCEPTFILES)
155
156clean:
157	$(RM) $(CLEANFILES)
158
159bldenv: bldenv.sh stdenv.sh
160	$(RM) "$@"
161	sed -e '/# STDENV_START/ r stdenv.sh' bldenv.sh > "$@"
162	# Check for shell lint and fail if we hit warings
163	shlintout="$$( /usr/bin/ksh93 -n "$@" 2>&1 )" ; \
164		[[ "$${shlintout}" != "" ]] && \
165		{ print -r -- "$${shlintout}" ;	false ; } || true
166	$(CHMOD) +x "$@"
167
168bldenv.1: bldenv
169	$(RM) "$@"
170	(set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
171	sed 's/\.DS/.nf/g;s/\.DE/.fi/' > "$@"
172
173nightly: nightly.sh stdenv.sh
174	$(RM) "$@"
175	sed -e '/# STDENV_START/ r stdenv.sh' nightly.sh > nightly
176	$(CHMOD) +x "$@"
177
178include ../Makefile.targ
179
180