xref: /illumos-gate/usr/src/tools/Makefile (revision 7e3dbbac48aaad67ac841ba479a67a2081d6a02b)
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>.
271f5207b7SJohn Levon# Copyright (c) 2019, Joyent, Inc.
28ca13eaa5SAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
297c478bd9Sstevel@tonic-gate#
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gateinclude ../Makefile.master
327c478bd9Sstevel@tonic-gate
33c0855578SRichard Lowe# Bootstrap problem: 'cw' must be built before anything else can be built.
34c0855578SRichard Lowe# 'install.bin' should be built next, being the 'install' target dependency
35c0855578SRichard Lowe# for everything else.
36c0855578SRichard Lowe#
37c0855578SRichard Lowe# Because of somewhat cyclic dependency between them, both cw and install.bin
38c0855578SRichard Lowe# override the way we install binaries in their Makefiles.
397c478bd9Sstevel@tonic-gateBOOT_SUBDIRS= \
401f5207b7SJohn Levon	smatch \
411f5207b7SJohn Levon	.WAIT \
42c0855578SRichard Lowe	cw \
43c0855578SRichard Lowe	.WAIT \
447079b4f8SToomas Soome	install.bin \
457079b4f8SToomas Soome	.WAIT \
467079b4f8SToomas Soome	ctf
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gateCOMMON_SUBDIRS= \
497c478bd9Sstevel@tonic-gate	codereview \
5023259b79Srotondo	codesign \
517c478bd9Sstevel@tonic-gate	cscope-fast \
527c478bd9Sstevel@tonic-gate	env \
537c478bd9Sstevel@tonic-gate	findunref \
5434c98957Smeem	lintdump \
5510d63b7dSRichard Lowe	make \
56e86c665fSToomas Soome	makesoftcore \
5710d63b7dSRichard Lowe	ndrgen \
5810d63b7dSRichard Lowe	onbld \
597c478bd9Sstevel@tonic-gate	protocmp \
607c478bd9Sstevel@tonic-gate	protolist \
617c478bd9Sstevel@tonic-gate	scripts
627c478bd9Sstevel@tonic-gate
637c478bd9Sstevel@tonic-gate#
647c478bd9Sstevel@tonic-gate#  special versions of commands for use only in build
657c478bd9Sstevel@tonic-gate#
66df8bdeb3SjohnzUNSHIPPED_SUBDIRS = \
67503609a9SYuri Pankov	localedef \
68503609a9SYuri Pankov	mandoc \
69503609a9SYuri Pankov	tic \
704b529e40SToomas Soome	vtfontcvt \
71503609a9SYuri Pankov	zic
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gatesparc_SUBDIRS= \
74b31b5de1SJerry Gilliam	chk4ubin \
757c478bd9Sstevel@tonic-gate	stabs \
767c478bd9Sstevel@tonic-gate	tokenize
777c478bd9Sstevel@tonic-gate
787c478bd9Sstevel@tonic-gatei386_SUBDIRS=		\
79ae115bc7Smrj	aw		\
80*7e3dbbacSRobert Mustacchi	cpcgen		\
81ae115bc7Smrj	elfextract	\
820cc5983cSToomas Soome	mbh_patch	\
830cc5983cSToomas Soome	btxld
847c478bd9Sstevel@tonic-gate
857c478bd9Sstevel@tonic-gateLINTSUBDIRS= \
867c478bd9Sstevel@tonic-gate	codereview \
877c478bd9Sstevel@tonic-gate	ctf \
887c478bd9Sstevel@tonic-gate	cw \
897c478bd9Sstevel@tonic-gate	findunref \
9034c98957Smeem	lintdump \
91d0e51869Samw	ndrgen \
927c478bd9Sstevel@tonic-gate	protocmp \
937c478bd9Sstevel@tonic-gate	protolist
947c478bd9Sstevel@tonic-gate
95df8bdeb3SjohnzSUBDIRS= \
96df8bdeb3Sjohnz	$($(MACH)_SUBDIRS) \
97df8bdeb3Sjohnz	$(COMMON_SUBDIRS) \
98df8bdeb3Sjohnz	$(UNSHIPPED_SUBDIRS)
997c478bd9Sstevel@tonic-gate
1007c478bd9Sstevel@tonic-gateinclude Makefile.tools
1017c478bd9Sstevel@tonic-gate
1027c478bd9Sstevel@tonic-gateROOTDIRS= \
1032e02daeeSRainer Orth	$(ROOTOPT) \
1047c478bd9Sstevel@tonic-gate	$(ROOTONBLD) \
1057c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/bin \
1067c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/bin/$(MACH) \
1077c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/lib \
1087c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/lib/$(MACH) \
10910d63b7dSRichard Lowe	$(ROOTONBLD)/lib/$(MACH)/64 \
11075ce41a5SAli Bahrami	$(ROOTONBLD)/lib/perl \
1117c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/env \
1127c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/etc \
11375ce41a5SAli Bahrami	$(ROOTONBLD)/etc/exception_lists \
11410d63b7dSRichard Lowe	$(ROOTONBLD)/share \
1157c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/man \
1166cad8c54SRyan Zezeski	$(ROOTONBLD)/man/man1onbld
1177c478bd9Sstevel@tonic-gate
118ca13eaa5SAndy Fiddaman$(BUILDPY2TOOLS)ROOTDIRS += \
119ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
120ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
121ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
122ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm
123ca13eaa5SAndy Fiddaman
124ca13eaa5SAndy Fiddaman$(BUILDPY3TOOLS)ROOTDIRS += \
125ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION) \
126ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld \
127ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/__pycache__ \
128ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks \
129ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks/__pycache__ \
130ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm \
131ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm/__pycache__
132ca13eaa5SAndy Fiddaman
1337c478bd9Sstevel@tonic-gateall :=		TARGET= install
1347c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
1357c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
1367c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
1377c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
1387c478bd9Sstevel@tonic-gate_msg :=		TARGET= _msg
1397c478bd9Sstevel@tonic-gate
1407c478bd9Sstevel@tonic-gate.KEEP_STATE:
1417c478bd9Sstevel@tonic-gate
142ead1f93eSLiane Praza#
143ead1f93eSLiane Praza# Only create directories in the tools proto area when doing an actual
144ead1f93eSLiane Praza# build, not a clean or clobber.
145ead1f93eSLiane Praza#
146ead1f93eSLiane PrazaDOROOTDIRS= $(ROOTDIRS)
147ead1f93eSLiane Prazaclobber:= DOROOTDIRS=
148ead1f93eSLiane Prazaclean:= DOROOTDIRS=
149ead1f93eSLiane Praza
150ca13eaa5SAndy Fiddaman$(BUILDPY2TOOLS)DOROOTONBLDLIBPY= $(ROOTONBLDLIBPY)
15189d58ee0SChris Fraireclobber:= DOROOTONBLDLIBPY=
15289d58ee0SChris Fraireclean:= DOROOTONBLDLIBPY=
15389d58ee0SChris Fraire
15498157a70Sakolball install: $(SUBDIRS)
1557c478bd9Sstevel@tonic-gate
156df8bdeb3Sjohnzclean: $(SUBDIRS)
1577c478bd9Sstevel@tonic-gate
158df8bdeb3Sjohnzclobber: $(SUBDIRS)
1597c478bd9Sstevel@tonic-gate	$(RM) -rf $(TOOLS_PROTO)
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gatelint: $(LINTSUBDIRS)
1627c478bd9Sstevel@tonic-gate
1637c478bd9Sstevel@tonic-gate_msg: $(MSGSUBDIRS)
1647c478bd9Sstevel@tonic-gate
165ead1f93eSLiane Praza.PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
16698157a70Sakolb
16703113b45Sakolb$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
16803113b45Sakolb
16989d58ee0SChris Fraire$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
1707c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1717c478bd9Sstevel@tonic-gate
172c0855578SRichard Lowe# Assume we don't have the install.bin available yet
1737c478bd9Sstevel@tonic-gate$(ROOTDIRS):
174c0855578SRichard Lowe	$(MKDIR) -p -m $(DIRMODE) $@
175ead1f93eSLiane Praza
17687ab3622SRichard Lowe$(ROOTONBLDLIBPY): $(ROOTDIRS)
1779f923083SAlexander Pyhalov	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
17887ab3622SRichard Lowe
179ead1f93eSLiane PrazaFRC:
180