xref: /illumos-gate/usr/src/tools/Makefile (revision 45137058c754e4417a4b9610ef655bc26b175a31)
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: 'cw' must be built before anything else can be built.
32# 'install.bin' should be built next, being the 'install' target dependency
33# for everything else.
34#
35# Because of somewhat cyclic dependency between them, both cw and install.bin
36# override the way we install binaries in their Makefiles.
37BOOT_SUBDIRS= \
38	cw \
39	.WAIT \
40	install.bin
41
42COMMON_SUBDIRS= \
43	codereview \
44	codesign \
45	cscope-fast \
46	ctf \
47	env \
48	findunref \
49	lintdump \
50	make \
51	ndrgen \
52	onbld \
53	protocmp \
54	protolist \
55	scripts
56
57#
58#  special versions of commands for use only in build
59#
60UNSHIPPED_SUBDIRS = \
61	localedef \
62	mandoc \
63	tic \
64	vtfontcvt \
65	zic
66
67sparc_SUBDIRS= \
68	chk4ubin \
69	stabs \
70	tokenize
71
72i386_SUBDIRS=		\
73	aw		\
74	elfextract	\
75	mbh_patch	\
76	btxld
77
78LINTSUBDIRS= \
79	codereview \
80	ctf \
81	cw \
82	findunref \
83	lintdump \
84	ndrgen \
85	protocmp \
86	protolist
87
88SUBDIRS= \
89	$($(MACH)_SUBDIRS) \
90	$(COMMON_SUBDIRS) \
91	$(UNSHIPPED_SUBDIRS)
92
93include Makefile.tools
94
95ROOTDIRS= \
96	$(ROOTOPT) \
97	$(ROOTONBLD) \
98	$(ROOTONBLD)/bin \
99	$(ROOTONBLD)/bin/$(MACH) \
100	$(ROOTONBLD)/lib \
101	$(ROOTONBLD)/lib/$(MACH) \
102	$(ROOTONBLD)/lib/$(MACH)/64 \
103	$(ROOTONBLD)/lib/perl \
104	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
105	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
106	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
107	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm \
108	$(ROOTONBLD)/env \
109	$(ROOTONBLD)/etc \
110	$(ROOTONBLD)/etc/exception_lists \
111	$(ROOTONBLD)/share \
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# Assume we don't have the install.bin available yet
155$(ROOTDIRS):
156	$(MKDIR) -p -m $(DIRMODE) $@
157
158$(ROOTONBLDLIBPY): $(ROOTDIRS)
159	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
160
161make: ctf
162
163FRC:
164