xref: /titanic_52/usr/src/tools/Makefile (revision 93be19b94b8b631e9abb3b71f9415817c441c051)
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>
25150a6952SToomas Soome# Copyright 2016 Toomas Soome <tsoome@me.com>
26fbf016e0SChris Fraire# Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
27*93be19b9SAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
287c478bd9Sstevel@tonic-gate#
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gateinclude ../Makefile.master
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gate# Bootstrap problem --
337c478bd9Sstevel@tonic-gate# 'cw' must be built before anything else can be built.
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gateBOOT_SUBDIRS= \
367c478bd9Sstevel@tonic-gate	cw
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateCOMMON_SUBDIRS= \
397c478bd9Sstevel@tonic-gate	codereview \
4023259b79Srotondo	codesign \
417c478bd9Sstevel@tonic-gate	cscope-fast \
427c478bd9Sstevel@tonic-gate	ctf \
437c478bd9Sstevel@tonic-gate	depcheck \
447c478bd9Sstevel@tonic-gate	env \
457c478bd9Sstevel@tonic-gate	findunref \
467c478bd9Sstevel@tonic-gate	gk \
477c478bd9Sstevel@tonic-gate	install.bin \
4834c98957Smeem	lintdump \
4910d63b7dSRichard Lowe	make \
5010d63b7dSRichard Lowe	ndrgen \
5110d63b7dSRichard Lowe	onbld \
5210d63b7dSRichard Lowe	pmodes \
537c478bd9Sstevel@tonic-gate	protocmp \
547c478bd9Sstevel@tonic-gate	protolist \
557c478bd9Sstevel@tonic-gate	scripts
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gate#
587c478bd9Sstevel@tonic-gate#  special versions of commands for use only in build
597c478bd9Sstevel@tonic-gate#
60df8bdeb3SjohnzUNSHIPPED_SUBDIRS = \
6195c635efSGarrett D'Amore	elfsign \
625d0e1406SMarcel Telka	mandoc \
635d0e1406SMarcel Telka	zic
647c478bd9Sstevel@tonic-gate
657c478bd9Sstevel@tonic-gatesparc_SUBDIRS= \
66b31b5de1SJerry Gilliam	chk4ubin \
677c478bd9Sstevel@tonic-gate	stabs \
687c478bd9Sstevel@tonic-gate	tokenize
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gatei386_SUBDIRS=		\
71ae115bc7Smrj	aw		\
7253548f91SRobert Mustacchi	cpcgen		\
73ae115bc7Smrj	elfextract	\
74150a6952SToomas Soome	mbh_patch	\
75150a6952SToomas Soome	btxld
767c478bd9Sstevel@tonic-gate
777c478bd9Sstevel@tonic-gateLINTSUBDIRS= \
787c478bd9Sstevel@tonic-gate	codereview \
797c478bd9Sstevel@tonic-gate	ctf \
807c478bd9Sstevel@tonic-gate	cw \
817c478bd9Sstevel@tonic-gate	findunref \
8234c98957Smeem	lintdump \
83d0e51869Samw	ndrgen \
847c478bd9Sstevel@tonic-gate	protocmp \
857c478bd9Sstevel@tonic-gate	protolist
867c478bd9Sstevel@tonic-gate
87df8bdeb3SjohnzSUBDIRS= \
88df8bdeb3Sjohnz	$($(MACH)_SUBDIRS) \
89df8bdeb3Sjohnz	$(COMMON_SUBDIRS) \
90df8bdeb3Sjohnz	$(UNSHIPPED_SUBDIRS)
917c478bd9Sstevel@tonic-gate
927c478bd9Sstevel@tonic-gateinclude Makefile.tools
937c478bd9Sstevel@tonic-gate
947c478bd9Sstevel@tonic-gateROOTDIRS= \
952e02daeeSRainer Orth	$(ROOTOPT) \
967c478bd9Sstevel@tonic-gate	$(ROOTONBLD) \
977c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/bin \
987c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/bin/$(MACH) \
997c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/lib \
1007c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/lib/$(MACH) \
10110d63b7dSRichard Lowe	$(ROOTONBLD)/lib/$(MACH)/64 \
10275ce41a5SAli Bahrami	$(ROOTONBLD)/lib/perl \
1037c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/env \
1047c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/etc \
10575ce41a5SAli Bahrami	$(ROOTONBLD)/etc/exception_lists \
10610d63b7dSRichard Lowe	$(ROOTONBLD)/share \
1077c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/gk \
1087c478bd9Sstevel@tonic-gate	$(ROOTONBLD)/man \
1096cad8c54SRyan Zezeski	$(ROOTONBLD)/man/man1onbld
1107c478bd9Sstevel@tonic-gate
111*93be19b9SAndy Fiddaman$(BUILDPY2TOOLS)ROOTDIRS += \
112*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
113*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
114*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
115*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm
116*93be19b9SAndy Fiddaman
117*93be19b9SAndy Fiddaman$(BUILDPY3TOOLS)ROOTDIRS += \
118*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION) \
119*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld \
120*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/__pycache__ \
121*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks \
122*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks/__pycache__ \
123*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm \
124*93be19b9SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm/__pycache__
125*93be19b9SAndy Fiddaman
1267c478bd9Sstevel@tonic-gateall :=		TARGET= install
1277c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
1287c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
1297c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
1307c478bd9Sstevel@tonic-gatelint :=		TARGET= lint
1317c478bd9Sstevel@tonic-gate_msg :=		TARGET= _msg
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gate.KEEP_STATE:
1347c478bd9Sstevel@tonic-gate
135ead1f93eSLiane Praza#
136ead1f93eSLiane Praza# Only create directories in the tools proto area when doing an actual
137ead1f93eSLiane Praza# build, not a clean or clobber.
138ead1f93eSLiane Praza#
139ead1f93eSLiane PrazaDOROOTDIRS= $(ROOTDIRS)
140ead1f93eSLiane Prazaclobber:= DOROOTDIRS=
141ead1f93eSLiane Prazaclean:= DOROOTDIRS=
142ead1f93eSLiane Praza
143*93be19b9SAndy Fiddaman$(BUILDPY2TOOLS)DOROOTONBLDLIBPY= $(ROOTONBLDLIBPY)
144fbf016e0SChris Fraireclobber:= DOROOTONBLDLIBPY=
145fbf016e0SChris Fraireclean:= DOROOTONBLDLIBPY=
146fbf016e0SChris Fraire
14798157a70Sakolball install: $(SUBDIRS)
1487c478bd9Sstevel@tonic-gate
149df8bdeb3Sjohnzclean: $(SUBDIRS)
1507c478bd9Sstevel@tonic-gate
151df8bdeb3Sjohnzclobber: $(SUBDIRS)
1527c478bd9Sstevel@tonic-gate	$(RM) -rf $(TOOLS_PROTO)
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gatelint: $(LINTSUBDIRS)
1557c478bd9Sstevel@tonic-gate
1567c478bd9Sstevel@tonic-gate_msg: $(MSGSUBDIRS)
1577c478bd9Sstevel@tonic-gate
158ead1f93eSLiane Praza.PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
15998157a70Sakolb
16003113b45Sakolb$(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
16103113b45Sakolb
162fbf016e0SChris Fraire$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
1637c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1647c478bd9Sstevel@tonic-gate
1657c478bd9Sstevel@tonic-gate$(ROOTDIRS):
1667c478bd9Sstevel@tonic-gate	$(INS.dir)
167ead1f93eSLiane Praza
16887ab3622SRichard Lowe$(ROOTONBLDLIBPY): $(ROOTDIRS)
1692fb4439dSAlexander Pyhalov	$(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
17087ab3622SRichard Lowe
17110d63b7dSRichard Lowemake: ctf
17210d63b7dSRichard Lowe
173ead1f93eSLiane PrazaFRC:
174