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 (c) 2019, Joyent, Inc.
  28 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
  29 #
  30 
  31 include ../Makefile.master
  32 
  33 # Bootstrap problem: 'cw' must be built before anything else can be built.
  34 # 'install.bin' should be built next, being the 'install' target dependency
  35 # for everything else.
  36 #
  37 # Because of somewhat cyclic dependency between them, both cw and install.bin
  38 # override the way we install binaries in their Makefiles.
  39 BOOT_SUBDIRS= \
  40         smatch \
  41         .WAIT \
  42         cw \
  43         .WAIT \
  44         install.bin \
  45         .WAIT \
  46         ctf
  47 
  48 COMMON_SUBDIRS= \
  49         codereview \
  50         codesign \
  51         cscope-fast \
  52         env \
  53         findunref \
  54         lintdump \
  55         make \
  56         makesoftcore \
  57         ndrgen \
  58         onbld \
  59         protocmp \
  60         protolist \
  61         scripts \
  62         sgs
  63 
  64 #
  65 #  special versions of commands for use only in build
  66 #
  67 UNSHIPPED_SUBDIRS = \
  68         $(SGSMSG) \
  69         $(SGSLIBCONV) \
  70         $(SGSLIBELF) \
  71         $(SGSLIBLDDBG) \
  72         $(SGSLIBLD) \
  73         $(SGSLD) \
  74         localedef \
  75         mandoc \
  76         tic \
  77         vtfontcvt \
  78         zic
  79 
  80 sparc_SUBDIRS= \
  81         chk4ubin \
  82         stabs \
  83         tokenize
  84 
  85 i386_SUBDIRS=           \
  86         aw              \
  87         cpcgen          \
  88         elfextract      \
  89         mbh_patch       \
  90         btxld
  91 
  92 $(INTEL_BLD)sgs: aw
  93 
  94 LINTSUBDIRS= \
  95         codereview \
  96         ctf \
  97         cw \
  98         findunref \
  99         lintdump \
 100         ndrgen \
 101         protocmp \
 102         protolist
 103 
 104 SUBDIRS= \
 105         $($(MACH)_SUBDIRS) \
 106         $(COMMON_SUBDIRS) \
 107         $(UNSHIPPED_SUBDIRS)
 108 
 109 include Makefile.tools
 110 
 111 ROOTDIRS= \
 112         $(ROOTOPT) \
 113         $(ROOTONBLD) \
 114         $(ROOTONBLD)/bin \
 115         $(ROOTONBLD)/bin/$(MACH) \
 116         $(ROOTONBLD)/lib \
 117         $(ROOTONBLD)/lib/$(MACH) \
 118         $(ROOTONBLD)/lib/$(MACH)/64 \
 119         $(ROOTONBLD)/lib/perl \
 120         $(ROOTONBLD)/env \
 121         $(ROOTONBLD)/etc \
 122         $(ROOTONBLD)/etc/exception_lists \
 123         $(ROOTONBLD)/share \
 124         $(ROOTONBLD)/man \
 125         $(ROOTONBLD)/man/man1onbld
 126 
 127 $(BUILDPY2TOOLS)ROOTDIRS += \
 128         $(ROOTONBLD)/lib/python$(PYTHON_VERSION) \
 129         $(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld \
 130         $(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Checks \
 131         $(ROOTONBLD)/lib/python$(PYTHON_VERSION)/onbld/Scm
 132 
 133 $(BUILDPY3TOOLS)ROOTDIRS += \
 134         $(ROOTONBLD)/lib/python$(PYTHON3_VERSION) \
 135         $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld \
 136         $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/__pycache__ \
 137         $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks \
 138         $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Checks/__pycache__ \
 139         $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm \
 140         $(ROOTONBLD)/lib/python$(PYTHON3_VERSION)/onbld/Scm/__pycache__
 141 
 142 all :=          TARGET= install
 143 install :=      TARGET= install
 144 clean :=        TARGET= clean
 145 clobber :=      TARGET= clobber
 146 lint :=         TARGET= lint
 147 _msg :=         TARGET= _msg
 148 
 149 .KEEP_STATE:
 150 
 151 #
 152 # Only create directories in the tools proto area when doing an actual
 153 # build, not a clean or clobber.
 154 #
 155 DOROOTDIRS= $(ROOTDIRS)
 156 clobber:= DOROOTDIRS=
 157 clean:= DOROOTDIRS=
 158 
 159 $(BUILDPY2TOOLS)DOROOTONBLDLIBPY= $(ROOTONBLDLIBPY)
 160 clobber:= DOROOTONBLDLIBPY=
 161 clean:= DOROOTONBLDLIBPY=
 162 
 163 all install: $(SUBDIRS)
 164 
 165 clean: $(SUBDIRS)
 166 
 167 clobber: $(SUBDIRS)
 168         $(RM) -rf $(TOOLS_PROTO)
 169 
 170 lint: $(LINTSUBDIRS)
 171 
 172 _msg: $(MSGSUBDIRS)
 173 
 174 .PARALLEL: $(SUBDIRS) $(CLOSED_SUBDIRS)
 175 
 176 $(SUBDIRS) $(CLOSED_SUBDIRS): $(BOOT_SUBDIRS)
 177 
 178 $(BOOT_SUBDIRS) $(SUBDIRS): $$(DOROOTDIRS) $$(DOROOTONBLDLIBPY) FRC
 179         @cd $@; pwd; $(MAKE) $(TARGET)
 180 
 181 # Assume we don't have the install.bin available yet
 182 $(ROOTDIRS):
 183         $(MKDIR) -p -m $(DIRMODE) $@
 184 
 185 $(ROOTONBLDLIBPY): $(ROOTDIRS)
 186         $(RM) -r $@; $(SYMLINK) python$(PYTHON_VERSION) $@
 187 
 188 FRC: