xref: /titanic_51/usr/src/tools/Makefile (revision 93be19b94b8b631e9abb3b71f9415817c441c051)
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#
23# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
24# Copyright 2014 Garrett D'Amore <garrett@damore.org>
25# Copyright 2016 Toomas Soome <tsoome@me.com>
26# Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
27# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
28#
29
30include ../Makefile.master
31
32# Bootstrap problem --
33# 'cw' must be built before anything else can be built.
34
35BOOT_SUBDIRS= \
36	cw
37
38COMMON_SUBDIRS= \
39	codereview \
40	codesign \
41	cscope-fast \
42	ctf \
43	depcheck \
44	env \
45	findunref \
46	gk \
47	install.bin \
48	lintdump \
49	make \
50	ndrgen \
51	onbld \
52	pmodes \
53	protocmp \
54	protolist \
55	scripts
56
57#
58#  special versions of commands for use only in build
59#
60UNSHIPPED_SUBDIRS = \
61	elfsign \
62	mandoc \
63	zic
64
65sparc_SUBDIRS= \
66	chk4ubin \
67	stabs \
68	tokenize
69
70i386_SUBDIRS=		\
71	aw		\
72	cpcgen		\
73	elfextract	\
74	mbh_patch	\
75	btxld
76
77LINTSUBDIRS= \
78	codereview \
79	ctf \
80	cw \
81	findunref \
82	lintdump \
83	ndrgen \
84	protocmp \
85	protolist
86
87SUBDIRS= \
88	$($(MACH)_SUBDIRS) \
89	$(COMMON_SUBDIRS) \
90	$(UNSHIPPED_SUBDIRS)
91
92include Makefile.tools
93
94ROOTDIRS= \
95	$(ROOTOPT) \
96	$(ROOTONBLD) \
97	$(ROOTONBLD)/bin \
98	$(ROOTONBLD)/bin/$(MACH) \
99	$(ROOTONBLD)/lib \
100	$(ROOTONBLD)/lib/$(MACH) \
101	$(ROOTONBLD)/lib/$(MACH)/64 \
102	$(ROOTONBLD)/lib/perl \
103	$(ROOTONBLD)/env \
104	$(ROOTONBLD)/etc \
105	$(ROOTONBLD)/etc/exception_lists \
106	$(ROOTONBLD)/share \
107	$(ROOTONBLD)/gk \
108	$(ROOTONBLD)/man \
109	$(ROOTONBLD)/man/man1onbld
110
111$(BUILDPY2TOOLS)ROOTDIRS += \
112	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
113	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
114	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
115	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm
116
117$(BUILDPY3TOOLS)ROOTDIRS += \
118	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION) \
119	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld \
120	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/__pycache__ \
121	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks \
122	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks/__pycache__ \
123	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm \
124	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm/__pycache__
125
126all :=		TARGET= install
127install :=	TARGET= install
128clean :=	TARGET= clean
129clobber :=	TARGET= clobber
130lint :=		TARGET= lint
131_msg :=		TARGET= _msg
132
133.KEEP_STATE:
134
135#
136# Only create directories in the tools proto area when doing an actual
137# build, not a clean or clobber.
138#
139DOROOTDIRS= $(ROOTDIRS)
140clobber:= DOROOTDIRS=
141clean:= DOROOTDIRS=
142
143$(BUILDPY2TOOLS)DOROOTONBLDLIBPY= $(ROOTONBLDLIBPY)
144clobber:= DOROOTONBLDLIBPY=
145clean:= DOROOTONBLDLIBPY=
146
147all install: $(SUBDIRS)
148
149clean: $(SUBDIRS)
150
151clobber: $(SUBDIRS)
152	$(RM) -rf $(TOOLS_PROTO)
153
154lint: $(LINTSUBDIRS)
155
156_msg: $(MSGSUBDIRS)
157
158.PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
159
160$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
161
162$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
163	@cd $@; pwd; $(MAKE) $(TARGET)
164
165$(ROOTDIRS):
166	$(INS.dir)
167
168$(ROOTONBLDLIBPY): $(ROOTDIRS)
169	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
170
171make: ctf
172
173FRC:
174