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