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