xref: /illumos-gate/usr/src/tools/Makefile (revision e86c665f2e10cf29ac3b5f93b53c60bef762a690)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5fb9f9b97Skupfer# Common Development and Distribution License (the "License").
6fb9f9b97Skupfer# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
212e02daeeSRainer Orth
227c478bd9Sstevel@tonic-gate#
2387ab3622SRichard Lowe# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
2495c635efSGarrett D'Amore# Copyright 2014 Garrett D'Amore <garrett@damore.org>
250cc5983cSToomas Soome# Copyright 2016 Toomas Soome <tsoome@me.com>
2689d58ee0SChris Fraire# Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
277c478bd9Sstevel@tonic-gate#
287c478bd9Sstevel@tonic-gate
297c478bd9Sstevel@tonic-gateinclude ../Makefile.master
307c478bd9Sstevel@tonic-gate
31c0855578SRichard Lowe# Bootstrap problem: 'cw' must be built before anything else can be built.
32c0855578SRichard Lowe# 'install.bin' should be built next, being the 'install' target dependency
33c0855578SRichard Lowe# for everything else.
34c0855578SRichard Lowe#
35c0855578SRichard Lowe# Because of somewhat cyclic dependency between them, both cw and install.bin
36c0855578SRichard Lowe# override the way we install binaries in their Makefiles.
377c478bd9Sstevel@tonic-gateBOOT_SUBDIRS= \
38c0855578SRichard Lowe	cw \
39c0855578SRichard Lowe	.WAIT \
40c0855578SRichard Lowe	install.bin
417c478bd9Sstevel@tonic-gate
427c478bd9Sstevel@tonic-gateCOMMON_SUBDIRS= \
437c478bd9Sstevel@tonic-gate	codereview \
4423259b79Srotondo	codesign \
457c478bd9Sstevel@tonic-gate	cscope-fast \
467c478bd9Sstevel@tonic-gate	ctf \
477c478bd9Sstevel@tonic-gate	env \
487c478bd9Sstevel@tonic-gate	findunref \
4934c98957Smeem	lintdump \
5010d63b7dSRichard Lowe	make \
51*e86c665fSToomas Soome	makesoftcore \
5210d63b7dSRichard Lowe	ndrgen \
5310d63b7dSRichard Lowe	onbld \
547c478bd9Sstevel@tonic-gate	protocmp \
557c478bd9Sstevel@tonic-gate	protolist \
567c478bd9Sstevel@tonic-gate	scripts
577c478bd9Sstevel@tonic-gate
587c478bd9Sstevel@tonic-gate#
597c478bd9Sstevel@tonic-gate#  special versions of commands for use only in build
607c478bd9Sstevel@tonic-gate#
61df8bdeb3SjohnzUNSHIPPED_SUBDIRS = \
62503609a9SYuri Pankov	localedef \
63503609a9SYuri Pankov	mandoc \
64503609a9SYuri Pankov	tic \
654b529e40SToomas Soome	vtfontcvt \
66503609a9SYuri Pankov	zic
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gatesparc_SUBDIRS= \
69b31b5de1SJerry Gilliam	chk4ubin \
707c478bd9Sstevel@tonic-gate	stabs \
717c478bd9Sstevel@tonic-gate	tokenize
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gatei386_SUBDIRS=		\
74ae115bc7Smrj	aw		\
75ae115bc7Smrj	elfextract	\
760cc5983cSToomas Soome	mbh_patch	\
770cc5983cSToomas Soome	btxld
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gateLINTSUBDIRS= \
807c478bd9Sstevel@tonic-gate	codereview \
817c478bd9Sstevel@tonic-gate	ctf \
827c478bd9Sstevel@tonic-gate	cw \
837c478bd9Sstevel@tonic-gate	findunref \
8434c98957Smeem	lintdump \
85d0e51869Samw	ndrgen \
867c478bd9Sstevel@tonic-gate	protocmp \
877c478bd9Sstevel@tonic-gate	protolist
887c478bd9Sstevel@tonic-gate
89df8bdeb3SjohnzSUBDIRS= \
90df8bdeb3Sjohnz	$($(MACH)_SUBDIRS) \
91df8bdeb3Sjohnz	$(COMMON_SUBDIRS) \
92df8bdeb3Sjohnz	$(UNSHIPPED_SUBDIRS)
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gateinclude Makefile.tools
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gateROOTDIRS= \
972e02daeeSRainer Orth	$(ROOTOPT) \
987c478bd9Sstevel@tonic-gate	$(ROOTONBLD) \
997c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/bin \
1007c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/bin/$(MACH) \
1017c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/lib \
1027c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/lib/$(MACH) \
10310d63b7dSRichard Lowe	$(ROOTONBLD)/lib/$(MACH)/64 \
10475ce41a5SAli Bahrami	$(ROOTONBLD)/lib/perl \
1059f923083SAlexander Pyhalov	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
1069f923083SAlexander Pyhalov	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
1079f923083SAlexander Pyhalov	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
1089f923083SAlexander Pyhalov	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm \
1097c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/env \
1107c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/etc \
11175ce41a5SAli Bahrami	$(ROOTONBLD)/etc/exception_lists \
11210d63b7dSRichard Lowe	$(ROOTONBLD)/share \
1137c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/man \
1146cad8c54SRyan Zezeski	$(ROOTONBLD)/man/man1onbld
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gateall :=		TARGET= install
1177c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
1187c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
1197c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
1207c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
1217c478bd9Sstevel@tonic-gate_msg :=		TARGET= _msg
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate.KEEP_STATE:
1247c478bd9Sstevel@tonic-gate
125ead1f93eSLiane Praza#
126ead1f93eSLiane Praza# Only create directories in the tools proto area when doing an actual
127ead1f93eSLiane Praza# build, not a clean or clobber.
128ead1f93eSLiane Praza#
129ead1f93eSLiane PrazaDOROOTDIRS= $(ROOTDIRS)
130ead1f93eSLiane Prazaclobber:= DOROOTDIRS=
131ead1f93eSLiane Prazaclean:= DOROOTDIRS=
132ead1f93eSLiane Praza
13389d58ee0SChris FraireDOROOTONBLDLIBPY= $(ROOTONBLDLIBPY)
13489d58ee0SChris Fraireclobber:= DOROOTONBLDLIBPY=
13589d58ee0SChris Fraireclean:= DOROOTONBLDLIBPY=
13689d58ee0SChris Fraire
13798157a70Sakolball install: $(SUBDIRS)
1387c478bd9Sstevel@tonic-gate
139df8bdeb3Sjohnzclean: $(SUBDIRS)
1407c478bd9Sstevel@tonic-gate
141df8bdeb3Sjohnzclobber: $(SUBDIRS)
1427c478bd9Sstevel@tonic-gate	$(RM) -rf $(TOOLS_PROTO)
1437c478bd9Sstevel@tonic-gate
1447c478bd9Sstevel@tonic-gatelint: $(LINTSUBDIRS)
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gate_msg: $(MSGSUBDIRS)
1477c478bd9Sstevel@tonic-gate
148ead1f93eSLiane Praza.PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
14998157a70Sakolb
15003113b45Sakolb$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
15103113b45Sakolb
15289d58ee0SChris Fraire$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
1537c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1547c478bd9Sstevel@tonic-gate
155c0855578SRichard Lowe# Assume we don't have the install.bin available yet
1567c478bd9Sstevel@tonic-gate$(ROOTDIRS):
157c0855578SRichard Lowe	$(MKDIR) -p -m $(DIRMODE) $@
158ead1f93eSLiane Praza
15987ab3622SRichard Lowe$(ROOTONBLDLIBPY): $(ROOTDIRS)
1609f923083SAlexander Pyhalov	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
16187ab3622SRichard Lowe
16210d63b7dSRichard Lowemake: ctf
16310d63b7dSRichard Lowe
164ead1f93eSLiane PrazaFRC:
165