xref: /illumos-gate/usr/src/tools/Makefile (revision d48be212)
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>.
27d8e4595bSJohn Levon# Copyright 2019 Joyent, Inc.
28ca13eaa5SAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
29d203f834SJason King# Copyright 2021 Jason King
307c478bd9Sstevel@tonic-gate#
317c478bd9Sstevel@tonic-gate
327c478bd9Sstevel@tonic-gateinclude ../Makefile.master
337c478bd9Sstevel@tonic-gate
34391889ecSAndy Fiddaman# Bootstrap problem: some utilities are pre-requisites for building everything
35391889ecSAndy Fiddaman# else:
36391889ecSAndy Fiddaman#    - smatch - as it is a shadow compiler
37391889ecSAndy Fiddaman#    - cw - as it is used to drive builds
38391889ecSAndy Fiddaman#    - install.bin - being the 'install' target dependency
39391889ecSAndy Fiddaman#    - ctf - being used to generate CTF data
40c0855578SRichard Lowe#
41391889ecSAndy Fiddaman# Anything built before 'install.bin' is present must override binary
42391889ecSAndy Fiddaman# installation rules in their makefiles. This includes the Makefile for
43391889ecSAndy Fiddaman# 'install.bin' itself.
44b8767451SRichard LoweBOOT_SUBDIRS=		\
45b8767451SRichard Lowe	smatch		\
46b8767451SRichard Lowe	.WAIT		\
47b8767451SRichard Lowe	cw		\
48b8767451SRichard Lowe	.WAIT		\
49b8767451SRichard Lowe	install.bin	\
50b8767451SRichard Lowe	.WAIT		\
517079b4f8SToomas Soome	ctf
527c478bd9Sstevel@tonic-gate
53b8767451SRichard LoweCOMMON_SUBDIRS=		\
54b8767451SRichard Lowe	codesign	\
55b8767451SRichard Lowe	cscope-fast	\
56b8767451SRichard Lowe	env		\
57d203f834SJason King	find_elf	\
58b8767451SRichard Lowe	findunref	\
59b8767451SRichard Lowe	lintdump	\
60b8767451SRichard Lowe	make		\
61b8767451SRichard Lowe	makesoftcore	\
62b8767451SRichard Lowe	ndrgen		\
63b8767451SRichard Lowe	onbld		\
64b8767451SRichard Lowe	protocmp	\
65b8767451SRichard Lowe	protolist	\
66b8767451SRichard Lowe	scripts		\
6769b1fd3fSRichard Lowe	sgs
687c478bd9Sstevel@tonic-gate
697c478bd9Sstevel@tonic-gate#
707c478bd9Sstevel@tonic-gate#  special versions of commands for use only in build
717c478bd9Sstevel@tonic-gate#
72b8767451SRichard LoweUNSHIPPED_SUBDIRS =		\
73b8767451SRichard Lowe	$(SGSMSG)		\
74b8767451SRichard Lowe	$(SGSLIBCONV)		\
75b8767451SRichard Lowe	$(SGSLIBELF)		\
76b8767451SRichard Lowe	$(SGSLIBLDDBG)		\
77b8767451SRichard Lowe	$(SGSLIBLD)		\
78b8767451SRichard Lowe	$(SGSLD)		\
79b8767451SRichard Lowe	geniconvtbl		\
80b8767451SRichard Lowe	localedef		\
81b8767451SRichard Lowe	mandoc			\
82b8767451SRichard Lowe	rpcgen			\
83b8767451SRichard Lowe	tic			\
84b8767451SRichard Lowe	vtfontcvt		\
85503609a9SYuri Pankov	zic
867c478bd9Sstevel@tonic-gate
87b8767451SRichard Lowei386_SUBDIRS=			\
88b8767451SRichard Lowe	cpcgen			\
89b8767451SRichard Lowe	elfextract		\
90b8767451SRichard Lowe	mbh_patch		\
910cc5983cSToomas Soome	btxld
927c478bd9Sstevel@tonic-gate
93b8767451SRichard LoweSUBDIRS=			\
94b8767451SRichard Lowe	$($(MACH)_SUBDIRS)	\
95b8767451SRichard Lowe	$(COMMON_SUBDIRS)	\
96df8bdeb3Sjohnz	$(UNSHIPPED_SUBDIRS)
977c478bd9Sstevel@tonic-gate
987c478bd9Sstevel@tonic-gateinclude Makefile.tools
997c478bd9Sstevel@tonic-gate
100b8767451SRichard LoweROOTDIRS=					\
101b8767451SRichard Lowe	$(ROOTOPT)				\
102b8767451SRichard Lowe	$(ROOTONBLD)				\
103b8767451SRichard Lowe	$(ROOTONBLD)/bin			\
104b8767451SRichard Lowe	$(ROOTONBLD)/bin/$(MACH)		\
1057a15b0ecSRichard Lowe	$(ROOTONBLD)/bin/$(MACH64)		\
106b8767451SRichard Lowe	$(ROOTONBLD)/lib			\
107b8767451SRichard Lowe	$(ROOTONBLD)/lib/$(MACH)		\
108b8767451SRichard Lowe	$(ROOTONBLD)/lib/$(MACH)/64		\
109b8767451SRichard Lowe	$(ROOTONBLD)/lib/perl			\
110b8767451SRichard Lowe	$(ROOTONBLD)/env			\
111b8767451SRichard Lowe	$(ROOTONBLD)/etc			\
112b8767451SRichard Lowe	$(ROOTONBLD)/etc/exception_lists	\
113b8767451SRichard Lowe	$(ROOTONBLD)/share			\
114b8767451SRichard Lowe	$(ROOTONBLD)/man			\
1156cad8c54SRyan Zezeski	$(ROOTONBLD)/man/man1onbld
1167c478bd9Sstevel@tonic-gate
117*70143b9fSRichard LoweROOTDIRS +=							\
118b8767451SRichard Lowe	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)				\
119b8767451SRichard Lowe	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld				\
120b8767451SRichard Lowe	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/__pycache__		\
121b8767451SRichard Lowe	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks			\
122b8767451SRichard Lowe	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks/__pycache__	\
123b8767451SRichard Lowe	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm			\
124ca13eaa5SAndy Fiddaman	$(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm/__pycache__
125ca13eaa5SAndy Fiddaman
1267c478bd9Sstevel@tonic-gateall :=		TARGET= install
1277c478bd9Sstevel@tonic-gateinstall :=	TARGET= install
1287c478bd9Sstevel@tonic-gateclean :=	TARGET= clean
1297c478bd9Sstevel@tonic-gateclobber :=	TARGET= clobber
1307c478bd9Sstevel@tonic-gate_msg :=		TARGET= _msg
1317c478bd9Sstevel@tonic-gate
1327c478bd9Sstevel@tonic-gate.KEEP_STATE:
1337c478bd9Sstevel@tonic-gate
134ead1f93eSLiane Praza#
135ead1f93eSLiane Praza# Only create directories in the tools proto area when doing an actual
136ead1f93eSLiane Praza# build, not a clean or clobber.
137ead1f93eSLiane Praza#
138ead1f93eSLiane PrazaDOROOTDIRS= $(ROOTDIRS)
139ead1f93eSLiane Prazaclobber:= DOROOTDIRS=
140ead1f93eSLiane Prazaclean:= DOROOTDIRS=
141ead1f93eSLiane Praza
14289d58ee0SChris Fraireclobber:= DOROOTONBLDLIBPY=
14389d58ee0SChris Fraireclean:= DOROOTONBLDLIBPY=
14489d58ee0SChris Fraire
14598157a70Sakolball install: $(SUBDIRS)
1467c478bd9Sstevel@tonic-gate
147df8bdeb3Sjohnzclean: $(SUBDIRS)
1487c478bd9Sstevel@tonic-gate
149df8bdeb3Sjohnzclobber: $(SUBDIRS)
1507c478bd9Sstevel@tonic-gate	$(RM) -rf $(TOOLS_PROTO)
1517c478bd9Sstevel@tonic-gate
152391889ecSAndy Fiddamanbootstrap: $(BOOT_SUBDIRS)
1537c478bd9Sstevel@tonic-gate
1547c478bd9Sstevel@tonic-gate_msg: $(MSGSUBDIRS)
1557c478bd9Sstevel@tonic-gate
15656ffda17SRichard Lowe.PARALLEL: $(SUBDIRS)
15798157a70Sakolb
15856ffda17SRichard Lowe$(SUBDIRS): $(BOOT_SUBDIRS)
15903113b45Sakolb
16089d58ee0SChris Fraire$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
1617c478bd9Sstevel@tonic-gate	@cd $@; pwd; $(MAKE) $(TARGET)
1627c478bd9Sstevel@tonic-gate
163c0855578SRichard Lowe# Assume we don't have the install.bin available yet
1647c478bd9Sstevel@tonic-gate$(ROOTDIRS):
165c0855578SRichard Lowe	$(MKDIR) -p -m $(DIRMODE) $@
166ead1f93eSLiane Praza
16787ab3622SRichard Lowe$(ROOTONBLDLIBPY): $(ROOTDIRS)
168*70143b9fSRichard Lowe	$(RM) -r $@; $(SYMLINK) python$(PYTHON3_VERSION) $@
16987ab3622SRichard Lowe
170ead1f93eSLiane PrazaFRC:
171