xref: /illumos-gate/usr/src/tools/Makefile (revision c193478586214940af708897e19c9a878b6a6223)
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	localedef \
60	mandoc \
61	tic \
62	zic
63
64sparc_SUBDIRS= \
65	chk4ubin \
66	stabs \
67	tokenize
68
69i386_SUBDIRS=		\
70	aw		\
71	elfextract	\
72	mbh_patch	\
73	btxld
74
75LINTSUBDIRS= \
76	codereview \
77	ctf \
78	cw \
79	findunref \
80	lintdump \
81	ndrgen \
82	protocmp \
83	protolist
84
85SUBDIRS= \
86	$($(MACH)_SUBDIRS) \
87	$(COMMON_SUBDIRS) \
88	$(UNSHIPPED_SUBDIRS)
89
90include Makefile.tools
91
92ROOTDIRS= \
93	$(ROOTOPT) \
94	$(ROOTONBLD) \
95	$(ROOTONBLD)/bin \
96	$(ROOTONBLD)/bin/$(MACH) \
97	$(ROOTONBLD)/lib \
98	$(ROOTONBLD)/lib/$(MACH) \
99	$(ROOTONBLD)/lib/$(MACH)/64 \
100	$(ROOTONBLD)/lib/perl \
101	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
102	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
103	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
104	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/hgext \
105	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm \
106	$(ROOTONBLD)/env \
107	$(ROOTONBLD)/etc \
108	$(ROOTONBLD)/etc/exception_lists \
109	$(ROOTONBLD)/share \
110	$(ROOTONBLD)/gk \
111	$(ROOTONBLD)/man \
112	$(ROOTONBLD)/man/man1onbld
113
114all :=		TARGET= install
115install :=	TARGET= install
116clean :=	TARGET= clean
117clobber :=	TARGET= clobber
118lint :=		TARGET= lint
119_msg :=		TARGET= _msg
120
121.KEEP_STATE:
122
123#
124# Only create directories in the tools proto area when doing an actual
125# build, not a clean or clobber.
126#
127DOROOTDIRS= $(ROOTDIRS)
128clobber:= DOROOTDIRS=
129clean:= DOROOTDIRS=
130
131all install: $(SUBDIRS)
132
133clean: $(SUBDIRS)
134
135clobber: $(SUBDIRS)
136	$(RM) -rf $(TOOLS_PROTO)
137
138lint: $(LINTSUBDIRS)
139
140_msg: $(MSGSUBDIRS)
141
142.PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
143
144$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
145
146$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $(ROOTONBLDLIBPY) FRC
147	@cd $@; pwd; $(MAKE) $(TARGET)
148
149$(ROOTDIRS):
150	$(INS.dir)
151
152$(ROOTONBLDLIBPY): $(ROOTDIRS)
153	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
154
155make: ctf
156
157FRC:
158