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