xref: /illumos-gate/usr/src/tools/Makefile (revision 1b8adde7ba7d5e04395c141c5400dc2cffd7d809)
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# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26include ../Makefile.master
27
28# Bootstrap problem --
29# 'cw' must be built before anything else can be built.
30
31BOOT_SUBDIRS= \
32	cw
33
34COMMON_SUBDIRS= \
35	abi \
36	bfuld \
37	codereview \
38	codesign \
39	cscope-fast \
40	ctf \
41	depcheck \
42	env \
43	fastfs \
44	findunref \
45	ndrgen \
46	onbld \
47	pmodes \
48	gk \
49	install.bin \
50	lintdump \
51	protocmp \
52	protolist \
53	scripts
54
55#
56#  special versions of commands for use only in build
57#
58UNSHIPPED_SUBDIRS = \
59	elfsign
60
61sparc_SUBDIRS= \
62	stabs \
63	tokenize
64
65i386_SUBDIRS=		\
66	aw		\
67	elfextract	\
68	mbh_patch
69
70LINTSUBDIRS= \
71	codereview \
72	ctf \
73	cw \
74	findunref \
75	lintdump \
76	ndrgen \
77	protocmp \
78	protolist
79
80SUBDIRS= \
81	$($(MACH)_SUBDIRS) \
82	$(COMMON_SUBDIRS) \
83	$(UNSHIPPED_SUBDIRS)
84
85#
86# Packages built here
87#
88COMMON_PKG_SUBDIRS= \
89	SUNWonbld
90
91sparc_PKG_SUBDIRS=
92
93i386_PKG_SUBDIRS= \
94	SUNWmrtools
95
96PKG_SUBDIRS= $($(MACH)_PKG_SUBDIRS) $(COMMON_PKG_SUBDIRS)
97
98include Makefile.tools
99
100ROOTDIRS= \
101	$(ROOTONBLD) \
102	$(ROOTONBLD)/bin \
103	$(ROOTONBLD)/bin/$(MACH) \
104	$(ROOTONBLD)/lib \
105	$(ROOTONBLD)/lib/$(MACH) \
106	$(ROOTONBLD)/lib/python \
107	$(ROOTONBLD)/lib/python/onbld \
108	$(ROOTONBLD)/lib/python/onbld/Checks \
109	$(ROOTONBLD)/lib/python/onbld/hgext \
110	$(ROOTONBLD)/lib/python/onbld/Scm \
111	$(ROOTONBLD)/env \
112	$(ROOTONBLD)/etc \
113	$(ROOTONBLD)/etc/abi \
114	$(ROOTONBLD)/gk \
115	$(ROOTONBLD)/man \
116	$(ROOTONBLD)/man/man1
117
118all :=		TARGET= install
119install :=	TARGET= install
120clean :=	TARGET= clean
121clobber :=	TARGET= clobber
122lint :=		TARGET= lint
123_msg :=		TARGET= _msg
124
125.KEEP_STATE:
126
127all install: $(SUBDIRS)
128
129clean: $(SUBDIRS)
130
131clobber: $(SUBDIRS)
132	$(RM) -rf $(TOOLS_PROTO)
133
134pkg: install .WAIT $(PKG_SUBDIRS)
135
136lint: $(LINTSUBDIRS)
137
138_msg: $(MSGSUBDIRS)
139
140.PARALLEL: $(SUBDIRS) $(PKG_SUBDIRS) $(CLOSED_SUBDIRS)
141
142$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
143
144$(BOOT_SUBDIRS) $(SUBDIRS): $(ROOTDIRS) FRC
145	@cd $@; pwd; $(MAKE) $(TARGET)
146
147$(PKG_SUBDIRS): FRC
148	@cd $@; pwd; $(MAKE) install
149
150FRC:
151
152$(ROOTDIRS):
153	$(INS.dir)
154