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