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