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