xref: /illumos-gate/usr/src/tools/Makefile (revision 8c69cc8fbe729fa7b091e901c4b50508ccc6bb33)
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	vtfontcvt \
64	zic
65
66sparc_SUBDIRS= \
67	chk4ubin \
68	stabs \
69	tokenize
70
71i386_SUBDIRS=		\
72	aw		\
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)/lib/python$(PYTHON_VERSION) \
104	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
105	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
106	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/hgext \
107	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm \
108	$(ROOTONBLD)/env \
109	$(ROOTONBLD)/etc \
110	$(ROOTONBLD)/etc/exception_lists \
111	$(ROOTONBLD)/share \
112	$(ROOTONBLD)/gk \
113	$(ROOTONBLD)/man \
114	$(ROOTONBLD)/man/man1onbld
115
116all :=		TARGET= install
117install :=	TARGET= install
118clean :=	TARGET= clean
119clobber :=	TARGET= clobber
120lint :=		TARGET= lint
121_msg :=		TARGET= _msg
122
123.KEEP_STATE:
124
125#
126# Only create directories in the tools proto area when doing an actual
127# build, not a clean or clobber.
128#
129DOROOTDIRS= $(ROOTDIRS)
130clobber:= DOROOTDIRS=
131clean:= DOROOTDIRS=
132
133DOROOTONBLDLIBPY= $(ROOTONBLDLIBPY)
134clobber:= DOROOTONBLDLIBPY=
135clean:= DOROOTONBLDLIBPY=
136
137all install: $(SUBDIRS)
138
139clean: $(SUBDIRS)
140
141clobber: $(SUBDIRS)
142	$(RM) -rf $(TOOLS_PROTO)
143
144lint: $(LINTSUBDIRS)
145
146_msg: $(MSGSUBDIRS)
147
148.PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
149
150$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
151
152$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
153	@cd $@; pwd; $(MAKE) $(TARGET)
154
155$(ROOTDIRS):
156	$(INS.dir)
157
158$(ROOTONBLDLIBPY): $(ROOTDIRS)
159	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
160
161make: ctf
162
163FRC:
164