xref: /titanic_52/usr/src/tools/scripts/Makefile (revision 9e4fd9006fa1ae57c570d6186137c6d81377d395)
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# Copyright 2020 Joyent, Inc.
26
27SHELL=/usr/bin/ksh93
28
29SCRIPTS= \
30	bldenv \
31	nightly
32
33SHFILES= \
34	Install \
35	build_cscope \
36	bringovercheck \
37	checkpaths \
38	checkproto \
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	wsdiff
74
75SCRIPTLINKS= \
76	git-nits
77
78MAN1ONBLDFILES= \
79	Install.1onbld \
80	bldenv.1onbld \
81	bringovercheck.1onbld \
82	cddlchk.1onbld \
83	checkpaths.1onbld \
84	check_rtime.1onbld \
85	cstyle.1onbld \
86	find_elf.1onbld \
87	flg.flp.1onbld \
88	git-pbchk.1onbld \
89	hdrchk.1onbld \
90	interface_check.1onbld \
91	interface_cmp.1onbld \
92	jstyle.1onbld \
93	mapfilechk.1onbld \
94	nightly.1onbld \
95	onu.1onbld \
96	sccscheck.1onbld \
97	webrev.1onbld \
98	which_scm.1onbld \
99	ws.1onbld \
100	wsdiff.1onbld \
101	xref.1onbld
102
103MAN1ONBLDLINKS= \
104	git-nits.1onbld
105
106MAKEFILES= \
107	xref.mk
108
109ETCFILES= \
110	its.conf \
111	its.reg
112
113EXCEPTFILES= \
114	check_rtime \
115	interface_check \
116	interface_cmp
117
118CLEANFILES = $(SHFILES) $(PERLFILES) $(PYFILES) bldenv.1onbld onu.sh
119
120onu.sh:	onu.sh.in
121	$(SED) -e "s:@PYTHON_VERSION@:$(PYTHON_VERSION):g" < onu.sh.in > $@
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
139$(ROOTONBLDBIN)/git-nits:
140	$(RM) $(ROOTONBLDBIN)/git-nits
141	$(SYMLINK) git-pbchk $(ROOTONBLDBIN)/git-nits
142
143$(ROOTONBLDMAN1ONBLD)/git-nits.1onbld:
144	$(RM) $(ROOTONBLDMAN1ONBLD)/git-nits.1onbld
145	$(SYMLINK) git-pbchk.1onbld $(ROOTONBLDMAN1ONBLD)/git-nits.1onbld
146
147install: all .WAIT $(ROOTONBLDSHFILES) $(ROOTONBLDPERLFILES)		\
148		$(ROOTONBLDPERLMODULES) $(ROOTONBLDPYFILES)		\
149		$(ROOTONBLDSCRIPTLINKS) $(ROOTONBLDMAN1ONBLDFILES)	\
150		$(ROOTONBLDMAKEFILES) $(ROOTONBLDETCFILES)		\
151		$(ROOTONBLDEXCEPTFILES) $(ROOTONBLDMAN1ONBLDLINKS)	\
152		$(ROOTONBLDSCRIPTS)
153
154clean:
155	$(RM) $(CLEANFILES)
156
157bldenv.1onbld: bldenv
158	$(RM) "$@"
159	(set +o errexit ; ksh93 $? --nroff ; true) 2>&1 | \
160	sed -e 's/\.DS/.nf/g;s/\.DE/.fi/' \
161	-e 's/\.TH BLDENV 1/.TH BLDENV 1ONBLD/' \
162	-e 's/(1)/(1ONBLD)/' > "$@"
163
164include ../Makefile.targ
165
166