xref: /illumos-gate/usr/src/tools/Makefile (revision ea4ea50f064c5468142b24627acad09a41f060cb)
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	makesoftcore \
52	ndrgen \
53	onbld \
54	protocmp \
55	protolist \
56	scripts
57
58#
59#  special versions of commands for use only in build
60#
61UNSHIPPED_SUBDIRS = \
62	localedef \
63	mandoc \
64	tic \
65	vtfontcvt \
66	zic
67
68sparc_SUBDIRS= \
69	chk4ubin \
70	stabs \
71	tokenize
72
73i386_SUBDIRS=		\
74	aw		\
75	elfextract	\
76	mbh_patch	\
77	btxld
78
79LINTSUBDIRS= \
80	codereview \
81	ctf \
82	cw \
83	findunref \
84	lintdump \
85	ndrgen \
86	protocmp \
87	protolist
88
89SUBDIRS= \
90	$($(MACH)_SUBDIRS) \
91	$(COMMON_SUBDIRS) \
92	$(UNSHIPPED_SUBDIRS)
93
94include Makefile.tools
95
96ROOTDIRS= \
97	$(ROOTOPT) \
98	$(ROOTONBLD) \
99	$(ROOTONBLD)/bin \
100	$(ROOTONBLD)/bin/$(MACH) \
101	$(ROOTONBLD)/lib \
102	$(ROOTONBLD)/lib/$(MACH) \
103	$(ROOTONBLD)/lib/$(MACH)/64 \
104	$(ROOTONBLD)/lib/perl \
105	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
106	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
107	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
108	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm \
109	$(ROOTONBLD)/env \
110	$(ROOTONBLD)/etc \
111	$(ROOTONBLD)/etc/exception_lists \
112	$(ROOTONBLD)/share \
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# Assume we don't have the install.bin available yet
156$(ROOTDIRS):
157	$(MKDIR) -p -m $(DIRMODE) $@
158
159$(ROOTONBLDLIBPY): $(ROOTDIRS)
160	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
161
162make: ctf
163
164FRC:
165