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