xref: /illumos-gate/usr/src/tools/Makefile (revision c81a25e9d3950dc5fab08d21f8be56d463b32c7a)
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#
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	localedef \
61	mandoc \
62	tic \
63	zic
64
65sparc_SUBDIRS= \
66	chk4ubin \
67	stabs \
68	tokenize
69
70i386_SUBDIRS=		\
71	aw		\
72	elfextract	\
73	mbh_patch	\
74	btxld
75
76LINTSUBDIRS= \
77	codereview \
78	ctf \
79	cw \
80	findunref \
81	lintdump \
82	ndrgen \
83	protocmp \
84	protolist
85
86SUBDIRS= \
87	$($(MACH)_SUBDIRS) \
88	$(COMMON_SUBDIRS) \
89	$(UNSHIPPED_SUBDIRS)
90
91include Makefile.tools
92
93ROOTDIRS= \
94	$(ROOTOPT) \
95	$(ROOTONBLD) \
96	$(ROOTONBLD)/bin \
97	$(ROOTONBLD)/bin/$(MACH) \
98	$(ROOTONBLD)/lib \
99	$(ROOTONBLD)/lib/$(MACH) \
100	$(ROOTONBLD)/lib/$(MACH)/64 \
101	$(ROOTONBLD)/lib/perl \
102	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
103	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
104	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
105	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/hgext \
106	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm \
107	$(ROOTONBLD)/env \
108	$(ROOTONBLD)/etc \
109	$(ROOTONBLD)/etc/exception_lists \
110	$(ROOTONBLD)/share \
111	$(ROOTONBLD)/gk \
112	$(ROOTONBLD)/man \
113	$(ROOTONBLD)/man/man1onbld
114
115all :=		TARGET= install
116install :=	TARGET= install
117clean :=	TARGET= clean
118clobber :=	TARGET= clobber
119lint :=		TARGET= lint
120_msg :=		TARGET= _msg
121
122.KEEP_STATE:
123
124#
125# Only create directories in the tools proto area when doing an actual
126# build, not a clean or clobber.
127#
128DOROOTDIRS= $(ROOTDIRS)
129clobber:= DOROOTDIRS=
130clean:= DOROOTDIRS=
131
132DOROOTONBLDLIBPY= $(ROOTONBLDLIBPY)
133clobber:= DOROOTONBLDLIBPY=
134clean:= DOROOTONBLDLIBPY=
135
136all install: $(SUBDIRS)
137
138clean: $(SUBDIRS)
139
140clobber: $(SUBDIRS)
141	$(RM) -rf $(TOOLS_PROTO)
142
143lint: $(LINTSUBDIRS)
144
145_msg: $(MSGSUBDIRS)
146
147.PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
148
149$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
150
151$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
152	@cd $@; pwd; $(MAKE) $(TARGET)
153
154$(ROOTDIRS):
155	$(INS.dir)
156
157$(ROOTONBLDLIBPY): $(ROOTDIRS)
158	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
159
160make: ctf
161
162FRC:
163