xref: /illumos-gate/usr/src/tools/scripts/Makefile (revision e4f5a11d4a234623168c1558fcdf4341e11769e1)
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 (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
23#
24
25SHELL=/usr/bin/ksh93
26
27SHFILES= \
28	Install \
29	bfu \
30	bindrop \
31	bldenv \
32	build_cscope \
33	bringovercheck \
34	checkpaths \
35	checkproto \
36	cryptodrop \
37	cstyle \
38	elfcmp \
39	flg.flp \
40	genoffsets \
41	hgsetup \
42	keywords \
43	makebfu \
44	mkbfu \
45	mkclosed \
46	nightly \
47	onu \
48	protocmp.terse \
49	sccscheck \
50	sccscp \
51	sccshist \
52	sccsmv \
53	sccsrm \
54	webrev \
55	which_scm \
56	ws \
57	wx \
58	wx2hg \
59	xref
60
61PERLFILES= \
62	check_rtime \
63	find_elf \
64	interface_check \
65	interface_cmp \
66	jstyle \
67	mkreadme_osol \
68	mktpl \
69	validate_flg \
70	validate_paths \
71	wdiff
72
73PERLMODULES= \
74	onbld_elfmod.pm \
75	onbld_elfmod_vertype.pm
76
77
78PYFILES= \
79	cddlchk \
80	copyrightchk \
81	hdrchk \
82	hg-active \
83	mapfilechk \
84	rtichk \
85	validate_pkg \
86	wsdiff
87
88MAN1FILES= \
89	Install.1 \
90	bldenv.1 \
91	bringovercheck.1 \
92	cddlchk.1 \
93	checkpaths.1 \
94	check_rtime.1 \
95	cstyle.1 \
96	find_elf.1 \
97	flg.flp.1 \
98	hdrchk.1 \
99	interface_check.1 \
100	interface_cmp.1 \
101	hgsetup.1 \
102	jstyle.1 \
103	mapfilechk.1 \
104	nightly.1 \
105	onu.1 \
106	sccscheck.1 \
107	sccscp.1 \
108	sccsmv.1 \
109	sccsrm.1 \
110	webrev.1 \
111	which_scm.1 \
112	ws.1 \
113	wsdiff.1 \
114	wx.1 \
115	wx2hg.1 \
116	xref.1
117
118MAKEFILES= \
119	xref.mk
120
121ETCFILES= \
122	hgstyle \
123	its.conf \
124	its.reg
125
126EXCEPTFILES= \
127	check_rtime \
128	interface_check \
129	interface_cmp
130
131CLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1
132
133include ../Makefile.tools
134
135
136$(ROOTONBLDETCFILES)	:= FILEMODE=	644
137$(ROOTONBLDEXCEPTFILES)	:= FILEMODE=	644
138$(ROOTONBLDPERLMODULES)	:= FILEMODE=	644
139$(ROOTONBLDMAKEFILES)	:= FILEMODE=	644
140$(ROOTONBLDMAN1FILES)	:= FILEMODE=	644
141
142.KEEP_STATE:
143
144all:	$(SHFILES) $(PERLFILES) $(PERLMODULES) $(PYFILES) \
145	$(MAN1FILES) $(MAKEFILES)
146
147install: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES)	\
148		$(ROOTONBLDPERLMODULES) $(ROOTONBLDPYFILES)	\
149		$(ROOTONBLDMAN1FILES) $(ROOTONBLDMAKEFILES)	\
150		$(ROOTONBLDETCFILES) $(ROOTONBLDEXCEPTFILES)
151
152clean:
153	$(RM) $(CLEANFILES)
154
155bldenv: bldenv.sh stdenv.sh
156	$(RM) "$@"
157	sed -e '/# STDENV_START/ r stdenv.sh' bldenv.sh > "$@"
158	# Check for shell lint and fail if we hit warings
159	shlintout="$$( /usr/bin/ksh93 -n "$@" 2>&1 )" ; \
160		[[ "$${shlintout}" != "" ]] && \
161		{ print -r -- "$${shlintout}" ;	false ; } || true
162	$(CHMOD) +x "$@"
163
164bldenv.1: bldenv
165	$(RM) "$@"
166	(set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
167	sed 's/\.DS/.nf/g;s/\.DE/.fi/' > "$@"
168
169nightly: nightly.sh stdenv.sh
170	$(RM) "$@"
171	sed -e '/# STDENV_START/ r stdenv.sh' nightly.sh > nightly
172	$(CHMOD) +x "$@"
173
174include ../Makefile.targ
175
176