xref: /illumos-gate/usr/src/tools/Makefile (revision e8031f0a8ed0e45c6d8847c5e09424e66fd34a4b)
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 2005 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	cscope-fast \
40	ctf \
41	depcheck \
42	env \
43	fastfs \
44	findunref \
45	pmodes \
46	gk \
47	install.bin \
48	protocmp \
49	protolist \
50	scripts
51
52#
53#  special versions of commands for use only in build
54#
55CLOSED_UNSHIPPED_SUBDIRS = \
56	elfsign
57
58sparc_SUBDIRS= \
59	stabs \
60	tokenize
61
62i386_SUBDIRS= \
63	aw
64
65LINTSUBDIRS= \
66	codereview \
67	ctf \
68	cw \
69	findunref \
70	protocmp \
71	protolist
72
73SUBDIRS= $(BOOT_SUBDIRS) $($(MACH)_SUBDIRS) $(COMMON_SUBDIRS)
74
75$(CLOSED_BUILD)CLOSED_SUBDIRS= $(CLOSED_UNSHIPPED_SUBDIRS)
76
77#
78# Packages built here
79#
80COMMON_PKG_SUBDIRS= \
81	SUNWonbld
82
83sparc_PKG_SUBDIRS=
84
85i386_PKG_SUBDIRS= \
86	SUNWmrtools
87
88PKG_SUBDIRS= $($(MACH)_PKG_SUBDIRS) $(COMMON_PKG_SUBDIRS)
89
90include Makefile.tools
91
92ROOTDIRS= \
93	$(ROOTONBLD) \
94	$(ROOTONBLD)/bin \
95	$(ROOTONBLD)/bin/$(MACH) \
96	$(ROOTONBLD)/lib \
97	$(ROOTONBLD)/lib/$(MACH) \
98	$(ROOTONBLD)/env \
99	$(ROOTONBLD)/etc \
100	$(ROOTONBLD)/etc/abi \
101	$(ROOTONBLD)/gk \
102	$(ROOTONBLD)/man \
103	$(ROOTONBLD)/man/man1
104
105all :=		TARGET= install
106install :=	TARGET= install
107clean :=	TARGET= clean
108clobber :=	TARGET= clobber
109lint :=		TARGET= lint
110_msg :=		TARGET= _msg
111
112.KEEP_STATE:
113
114all install: $(ROOTDIRS) .WAIT $(SUBDIRS) $(CLOSED_SUBDIRS)
115
116clean: $(SUBDIRS) $(CLOSED_SUBDIRS)
117
118clobber: $(SUBDIRS) $(CLOSED_SUBDIRS)
119	$(RM) -rf $(TOOLS_PROTO)
120
121pkg: install .WAIT $(PKG_SUBDIRS)
122
123lint: $(LINTSUBDIRS)
124
125_msg: $(MSGSUBDIRS)
126
127$(SUBDIRS): FRC
128	@cd $@; pwd; $(MAKE) $(TARGET)
129
130$(PKG_SUBDIRS): FRC
131	@cd $@; pwd; $(MAKE) install
132
133$(CLOSED_SUBDIRS): FRC
134	cd $(CLOSED)/tools/$@; pwd; $(MAKE) $(TARGET)
135
136FRC:
137
138$(ROOTDIRS):
139	$(INS.dir)
140