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