Home | History | Annotate | Download | only in sgs
      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 2008 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 # ident	"%Z%%M%	%I%	%E% SMI"
     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=	ar		m4		nm \
     90 		tsort		yacc
     91 POFILE=		sgs.po
     92 POFILES=	$(POSUBDIRS:%=%/%.po)
     93 
     94 MSGSUBDIRS=	ld		ldd		libld		liblddbg \
     95 		libldstab	librtld		rtld		libelf \
     96 		ldprof		libcrle		pvs		elfdump	\
     97 		elfedit		crle		moe 		lari \
     98 		librtld_db	elfwrap
     99 
    100 MSGDIR=		messages
    101 
    102 
    103 all :=		TARGET= all
    104 install :=	TARGET= install
    105 clean :=	TARGET= clean
    106 clobber :=	TARGET= clobber
    107 delete :=	TARGET= delete
    108 lint :=		TARGET= lint
    109 _msg :=		TARGET= catalog
    110 _msg_gettext :=	TARGET= catalog
    111 _msg_sgsmsg :=	TARGET= catalog
    112 chkmsg :=	TARGET= chkmsg
    113 
    114 
    115 .KEEP_STATE:
    116 
    117 .PARALLEL:	$(SUBDIRS)
    118 
    119 all install:	native-add .WAIT $(SUBDIRS)
    120 
    121 include		$(SRC)/cmd/Makefile.targ
    122 
    123 # Messaging support
    124 #
    125 _msg: _msg_gettext _msg_sgsmsg
    126 
    127 _msg_gettext: $(MSGDOMAIN)/$(POFILE)
    128 
    129 _msg_sgsmsg: $(MSGDIR)
    130 
    131 $(MSGDOMAIN)/$(POFILE): \
    132 		$(MSGDOMAIN) $(POFILE)
    133 
    134 $(POFILE):	$(POSUBDIRS)
    135 		$(RM) $(POFILE)
    136 		cat $(POFILES) > $(POFILE)
    137 
    138 $(MSGDIR):	$(MSGSUBDIRS) FRC
    139 		@ cd $@; pwd; $(MAKE) $(TARGET)
    140 
    141 chkmsg:		libconv $(MSGSUBDIRS) FRC
    142 
    143 # built from lib/Makefile
    144 install_lib:	FRC
    145 		@ cd lex; pwd; $(MAKE) $@
    146 		@ cd yacc; pwd; $(MAKE) $@
    147 
    148 lint:		$(SUBDIRS)
    149 
    150 delete \
    151 clean clobber:	native-clobber .WAIT $(SUBDIRS) $(MSGDIR)
    152 
    153 $(SUBDIRS):	FRC
    154 		@ cd $@; pwd; $(MAKE) $(TARGET)
    155 
    156 
    157 # Integration of ld and ld.so.1 in some developement cycles requires that both
    158 # of these modules be built using the new ld.  This `native' target allows us
    159 # to build a local ld which will then be used to build the delivered version of
    160 # itself and ld.so.1.  Once this new functionality appears in the standard ld
    161 # this target can be disabled.
    162 
    163 native-add:	native-proto FRC
    164 		@ cd tools/$(MACH); pwd; $(MAKE) native
    165 		@ cd libconv/$(MACH); pwd; $(MAKE)
    166 		@ cd libelf/$(MACH); pwd; $(MAKE) native
    167 		@ cd liblddbg/$(MACH); pwd; $(MAKE) native
    168 		@ cd libldstab/$(MACH); pwd; $(MAKE) native
    169 		@ cd libld/$(MACH); pwd; $(MAKE) native
    170 		@ cd ld/$(MACH); pwd; $(MAKE) native
    171 
    172 native-clobber:
    173 		@ cd tools; pwd; $(MAKE) $(TARGET)
    174 		$(RM) -r proto/$(MACH)
    175 
    176 native-proto:
    177 		-@mkdir -p proto/$(MACH)
    178 
    179 FRC:
    180 
    181 #
    182 # Cross-reference customization: ignore the directories named by XRPRUNE,
    183 # and tweak the file globs slightly.
    184 #
    185 XRPRUNE=	rtld.4.x packages abi
    186 XRADD=		*.msg mapfile* llib-[a-z]*
    187 XRDEL=		Makefile* kobj_*
    188 
    189 #
    190 # Establish a set of directories for xref to search.  As there are duplicates
    191 # of things like headers, and only one file will be added to the xref database,
    192 # we want xref to list the source file.
    193 #
    194 XRDIRS=		. \
    195 		../../head \
    196 		../../uts/common/krtld \
    197 		../../uts/common/sys \
    198 		../../uts/sparc/sys \
    199 		../../uts/sparc/krtld \
    200 		../../uts/intel/ia32/krtld \
    201 		../../uts/intel/amd64/krtld
    202 
    203 xref:		FRC
    204 		@ $(RM) cscope.*
    205 		xref -p -x cscope
    206