xref: /illumos-gate/usr/src/tools/scripts/Makefile (revision e1086107)
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#
26# Copyright 2020 Joyent, Inc.
27
28SHELL=/usr/bin/ksh93
29
30SCRIPTS= \
31	bldenv \
32	nightly
33
34SHFILES= \
35	Install \
36	build_cscope \
37	bringovercheck \
38	checkpaths \
39	cstyle \
40	elfcmp \
41	flg.flp \
42	genoffsets \
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	validate_flg \
58	validate_paths \
59	wdiff
60
61PERLMODULES= \
62	onbld_elfmod.pm \
63	onbld_elfmod_vertype.pm
64
65
66PYFILES= \
67	cddlchk \
68	copyrightchk \
69	git-pbchk \
70	hdrchk \
71	mapfilechk \
72	validate_pkg \
73	wscheck \
74	wsdiff
75
76SCRIPTLINKS= \
77	git-nits
78
79MAN1ONBLDFILES= \
80	Install.1onbld \
81	bldenv.1onbld \
82	bringovercheck.1onbld \
83	cddlchk.1onbld \
84	checkpaths.1onbld \
85	check_rtime.1onbld \
86	cstyle.1onbld \
87	find_elf.1onbld \
88	flg.flp.1onbld \
89	git-pbchk.1onbld \
90	hdrchk.1onbld \
91	interface_check.1onbld \
92	interface_cmp.1onbld \
93	jstyle.1onbld \
94	mapfilechk.1onbld \
95	nightly.1onbld \
96	onu.1onbld \
97	sccscheck.1onbld \
98	webrev.1onbld \
99	which_scm.1onbld \
100	ws.1onbld \
101	wsdiff.1onbld \
102	xref.1onbld
103
104MAN1ONBLDLINKS= \
105	git-nits.1onbld
106
107MAKEFILES= \
108	xref.mk
109
110ETCFILES= \
111	its.conf \
112	its.reg
113
114EXCEPTFILES= \
115	check_rtime \
116	interface_check \
117	interface_cmp
118
119CLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1onbld onu.sh
120
121include ../Makefile.tools
122
123ROOTONBLDSCRIPTLINKS = $(SCRIPTLINKS:%=$(ROOTONBLDBIN)/%)
124ROOTONBLDMAN1ONBLDLINKS = $(MAN1ONBLDLINKS:%=$(ROOTONBLDMAN1ONBLD)/%)
125
126$(ROOTONBLDETCFILES)		:= FILEMODE=	644
127$(ROOTONBLDEXCEPTFILES)		:= FILEMODE=	644
128$(ROOTONBLDPERLMODULES)		:= FILEMODE=	644
129$(ROOTONBLDMAKEFILES)		:= FILEMODE=	644
130$(ROOTONBLDMAN1ONBLDFILES)	:= FILEMODE=	644
131
132.KEEP_STATE:
133
134all:	$(SHFILES) $(PERLFILES) $(PERLMODULES) $(PYFILES) \
135	$(MAN1ONBLDFILES) $(MAKEFILES) $(SCRIPTS)
136
137onu.sh:	onu.sh.in
138	$(SED) -e "s:@PYTHON_VERSION@:$(PYTHON_VERSION):g" < onu.sh.in > $@
139
140$(ROOTONBLDBIN)/git-nits:
141	$(RM) $(ROOTONBLDBIN)/git-nits
142	$(SYMLINK) git-pbchk $(ROOTONBLDBIN)/git-nits
143
144$(ROOTONBLDMAN1ONBLD)/git-nits.1onbld:
145	$(RM) $(ROOTONBLDMAN1ONBLD)/git-nits.1onbld
146	$(SYMLINK) git-pbchk.1onbld $(ROOTONBLDMAN1ONBLD)/git-nits.1onbld
147
148install: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES)		\
149		$(ROOTONBLDPERLMODULES) $(ROOTONBLDPYFILES)		\
150		$(ROOTONBLDSCRIPTLINKS) $(ROOTONBLDMAN1ONBLDFILES)	\
151		$(ROOTONBLDMAKEFILES) $(ROOTONBLDETCFILES)		\
152		$(ROOTONBLDEXCEPTFILES) $(ROOTONBLDMAN1ONBLDLINKS)	\
153		$(ROOTONBLDSCRIPTS)
154
155clean:
156	$(RM) $(CLEANFILES)
157
158bldenv.1onbld: bldenv
159	$(RM) "$@"
160	(set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
161	sed -e 's/\.DS/.nf/g;s/\.DE/.fi/' \
162	-e 's/\.TH BLDENV 1/.TH BLDENV 1ONBLD "September 4, 2018"/' \
163	-e 's/.OP \([a-z]\) - flag -/.OP \\-\1/g' \
164	-e 's/(1)/(1ONBLD)/' > "$@"
165
166#
167# Not run by default: bootstrap...
168check:
169	$(ROOTONBLDBINMACH)/mandoc -Tlint -Wwarning $(MAN1ONBLDFILES)
170
171include ../Makefile.targ
172
173