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