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# Copyright (c) 2016, Chris Fraire <cfraire@me.com>. 27# Copyright 2019 Joyent, Inc. 28# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. 29# Copyright 2021 Jason King 30# 31 32include ../Makefile.master 33 34# Bootstrap problem: some utilities are pre-requisites for building everything 35# else: 36# - smatch - as it is a shadow compiler 37# - cw - as it is used to drive builds 38# - install.bin - being the 'install' target dependency 39# - ctf - being used to generate CTF data 40# 41# Anything built before 'install.bin' is present must override binary 42# installation rules in their makefiles. This includes the Makefile for 43# 'install.bin' itself. 44BOOT_SUBDIRS= \ 45 smatch \ 46 .WAIT \ 47 cw \ 48 .WAIT \ 49 install.bin \ 50 .WAIT \ 51 ctf \ 52 yacc \ 53 lex 54 55COMMON_SUBDIRS= \ 56 codesign \ 57 cscope-fast \ 58 env \ 59 find_elf \ 60 findunref \ 61 lintdump \ 62 make \ 63 makesoftcore \ 64 ndrgen \ 65 onbld \ 66 protocmp \ 67 protolist \ 68 scripts \ 69 sgs \ 70 svc 71 72# 73# special versions of commands for use only in build 74# 75UNSHIPPED_SUBDIRS = \ 76 $(SGSMSG) \ 77 $(SGSLIBCONV) \ 78 $(SGSLIBELF) \ 79 $(SGSLIBLDDBG) \ 80 $(SGSLIBLD) \ 81 $(SGSLD) \ 82 geniconvtbl \ 83 localedef \ 84 mandoc \ 85 rpcgen \ 86 tic \ 87 vtfontcvt \ 88 zic 89 90i386_SUBDIRS= \ 91 cpcgen \ 92 elfextract \ 93 mbh_patch \ 94 btxld 95 96SUBDIRS= \ 97 $($(MACH)_SUBDIRS) \ 98 $(COMMON_SUBDIRS) \ 99 $(UNSHIPPED_SUBDIRS) 100 101include Makefile.tools 102 103ROOTDIRS= \ 104 $(ROOTOPT) \ 105 $(ROOTONBLD) \ 106 $(ROOTONBLD)/bin \ 107 $(ROOTONBLD)/bin/$(MACH) \ 108 $(ROOTONBLD)/bin/$(MACH64) \ 109 $(ROOTONBLD)/lib \ 110 $(ROOTONBLD)/lib/$(MACH) \ 111 $(ROOTONBLD)/lib/$(MACH)/64 \ 112 $(ROOTONBLD)/lib/perl \ 113 $(ROOTONBLD)/env \ 114 $(ROOTONBLD)/etc \ 115 $(ROOTONBLD)/etc/exception_lists \ 116 $(ROOTONBLD)/share \ 117 $(ROOTONBLD)/share/lib \ 118 $(ROOTONBLD)/share/lib/ccs \ 119 $(ROOTONBLD)/man \ 120 $(ROOTONBLD)/man/man1onbld 121 122ROOTDIRS += \ 123 $(ROOTONBLD)/lib/python$(PYTHON3_VERSION) \ 124 $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld \ 125 $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/__pycache__ \ 126 $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks \ 127 $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks/__pycache__ \ 128 $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm \ 129 $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm/__pycache__ 130 131all := TARGET= install 132install := TARGET= install 133clean := TARGET= clean 134clobber := TARGET= clobber 135_msg := TARGET= _msg 136 137.KEEP_STATE: 138 139# 140# Only create directories in the tools proto area when doing an actual 141# build, not a clean or clobber. 142# 143DOROOTDIRS= $(ROOTDIRS) 144clobber:= DOROOTDIRS= 145clean:= DOROOTDIRS= 146 147clobber:= DOROOTONBLDLIBPY= 148clean:= DOROOTONBLDLIBPY= 149 150all install: $(SUBDIRS) 151 152clean: $(SUBDIRS) 153 154clobber: $(SUBDIRS) 155 $(RM) -rf $(TOOLS_PROTO) 156 157bootstrap: $(BOOT_SUBDIRS) 158 159_msg: $(MSGSUBDIRS) 160 161.PARALLEL: $(SUBDIRS) 162 163$(SUBDIRS): $(BOOT_SUBDIRS) 164 165$(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC 166 @cd $@; pwd; $(MAKE) $(TARGET) 167 168# Assume we don't have the install.bin available yet 169$(ROOTDIRS): 170 $(MKDIR) -p -m $(DIRMODE) $@ 171 172$(ROOTONBLDLIBPY): $(ROOTDIRS) 173 $(RM) -r $@; $(SYMLINK) python$(PYTHON3_VERSION) $@ 174 175FRC: 176