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 # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
  23 # Copyright 2016 RackTop Systems.
  24 # Copyright 2017 Joyent, Inc.
  25 # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
  26 #
  27 
  28 include         $(SRC)/cmd/Makefile.cmd
  29 
  30 # Note: Why SUBDIRS-common isn't sorted alphabetically
  31 #
  32 # The items under SGS are not independent of each other.
  33 # They must be built in an order that ensures that
  34 # all dependencies of an item have been built before the
  35 # item itself.
  36 #
  37 SUBDIRS-common= libconv         \
  38                 .WAIT           \
  39                 libdl           \
  40                 libelf          \
  41                 liblddbg        \
  42                 .WAIT           \
  43                 libld           \
  44                 libldmake       \
  45                 libldstab       \
  46                 librtld         \
  47                 libcrle         \
  48                 .WAIT           \
  49                 0@0             \
  50                 ld              \
  51                 ldd             \
  52                 lddstub         \
  53                 rtld            \
  54                 link_audit      \
  55                 .WAIT           \
  56                 librtld_db      \
  57                 ldprof          \
  58                 pvs             \
  59                 crle            \
  60                 ar              \
  61                 dump            \
  62                 elfdump         \
  63                 elfedit         \
  64                 elfwrap         \
  65                 error           \
  66                 gprof           \
  67                 lari            \
  68                 lex             \
  69                 lorder          \
  70                 m4              \
  71                 mcs             \
  72                 moe             \
  73                 nm              \
  74                 prof            \
  75                 ranlib          \
  76                 size            \
  77                 symorder        \
  78                 tsort           \
  79                 unifdef         \
  80                 yacc
  81 
  82 SUBDIRS-i386=
  83 SUBDIRS-sparc=  rtld.4.x
  84 
  85 SUBDIRS=        $(SUBDIRS-common) $(SUBDIRS-$(MACH))
  86 
  87 # Messaging support
  88 #
  89 POSUBDIRS=      m4              nm      tsort           yacc
  90 POFILE=         sgs.po
  91 POFILES=        $(POSUBDIRS:%=%/%.po)
  92 
  93 MSGSUBDIRS=     ld              ldd             libld           liblddbg \
  94                 libldstab       librtld         rtld            libelf \
  95                 ldprof          libcrle         pvs             elfdump \
  96                 elfedit         crle            moe             lari \
  97                 librtld_db      elfwrap         ar
  98 
  99 MSGDIR=         messages
 100 
 101 
 102 all :=          TARGET= all
 103 install :=      TARGET= install
 104 clean :=        TARGET= clean
 105 clobber :=      TARGET= clobber
 106 delete :=       TARGET= delete
 107 lint :=         TARGET= lint
 108 _msg :=         TARGET= catalog
 109 _msg_gettext := TARGET= catalog
 110 _msg_sgsmsg :=  TARGET= catalog
 111 chkmsg :=       TARGET= chkmsg
 112 
 113 
 114 .KEEP_STATE:
 115 
 116 .PARALLEL:      $(SUBDIRS)
 117 
 118 all install:    $(SUBDIRS)
 119 
 120 include         $(SRC)/cmd/Makefile.targ
 121 
 122 # Messaging support
 123 #
 124 _msg: _msg_gettext _msg_sgsmsg
 125 
 126 _msg_gettext: $(MSGDOMAIN)/$(POFILE)
 127 
 128 _msg_sgsmsg: $(MSGDIR)
 129 
 130 $(MSGDOMAIN)/$(POFILE): \
 131                 $(MSGDOMAIN) $(POFILE)
 132 
 133 $(POFILE):      $(POSUBDIRS)
 134                 $(RM) $(POFILE)
 135                 cat $(POFILES) > $(POFILE)
 136 
 137 $(MSGDIR):      $(MSGSUBDIRS) FRC
 138                 @ cd $@; pwd; $(MAKE) $(TARGET)
 139 
 140 chkmsg:         libconv $(MSGSUBDIRS) FRC
 141 
 142 check:          chkmsg
 143 
 144 # built from lib/Makefile
 145 install_lib:    FRC
 146                 @ cd lex; pwd; $(MAKE) $@
 147                 @ cd yacc; pwd; $(MAKE) $@
 148 
 149 lint:
 150 
 151 delete clean clobber: $(SUBDIRS) $(MSGDIR)
 152 
 153 $(SUBDIRS):     FRC
 154                 @ cd $@; pwd; $(MAKE) $(TARGET)
 155 
 156 FRC:
 157 
 158 #
 159 # Cross-reference customization: ignore the directories named by XRPRUNE,
 160 # and tweak the file globs slightly.
 161 #
 162 XRPRUNE=        rtld.4.x abi
 163 XRADD=          *.msg mapfile*
 164 XRDEL=          Makefile* kobj_*
 165 
 166 #
 167 # Establish a set of directories for xref to search.  As there are duplicates
 168 # of things like headers, and only one file will be added to the xref database,
 169 # we want xref to list the source file.
 170 #
 171 XRDIRS=         . \
 172                 ../../common/elfcap \
 173                 ../../head \
 174                 ../../uts/common/krtld \
 175                 ../../uts/common/sys \
 176                 ../../uts/sparc/sys \
 177                 ../../uts/sparc/krtld \
 178                 ../../uts/intel/ia32/krtld \
 179                 ../../uts/intel/amd64/krtld
 180 
 181 xref:           FRC
 182                 @ $(RM) cscope.*
 183                 xref -p -x cscope