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