xref: /titanic_41/usr/src/cmd/sgs/Makefile (revision 98c080d502548e68bb9815459ea56e6ae282c430)
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 2010 Sun Microsystems, Inc.  All rights reserved.
23# Use is subject to license terms.
24#
25
26include		$(SRC)/cmd/Makefile.cmd
27
28# Note: Why SUBDIRS-common isn't sorted alphabetically
29#
30# The items under SGS are not independent of each other.
31# They must be built in an order that ensures that
32# all dependencies of an item have been built before the
33# item itself.
34#
35SUBDIRS-common= libconv		\
36		.WAIT		\
37		libdl		\
38		libelf		\
39		liblddbg	\
40		.WAIT		\
41		libld		\
42		libldmake	\
43		libldstab	\
44		librtld		\
45		libcrle		\
46		.WAIT		\
47		0@0		\
48		ld		\
49		ldd		\
50		lddstub		\
51		rtld		\
52		link_audit	\
53		.WAIT		\
54		librtld_db	\
55		ldprof		\
56		pvs		\
57		crle		\
58		ar		\
59		dump		\
60		elfdump		\
61		elfedit		\
62		elfwrap		\
63		error		\
64		gprof		\
65		lari		\
66		lex		\
67		lorder		\
68		m4		\
69		mcs		\
70		moe		\
71		nm		\
72		prof		\
73		ranlib		\
74		size		\
75		symorder	\
76		tsort		\
77		unifdef		\
78		yacc
79
80SUBDIRS-i386=
81SUBDIRS-sparc=	rtld.4.x
82
83SUBDIRS=	$(SUBDIRS-common) $(SUBDIRS-$(MACH))
84
85# Messaging support
86#
87POSUBDIRS=	ar		m4		nm \
88		tsort		yacc
89POFILE=		sgs.po
90POFILES=	$(POSUBDIRS:%=%/%.po)
91
92MSGSUBDIRS=	ld		ldd		libld		liblddbg \
93		libldstab	librtld		rtld		libelf \
94		ldprof		libcrle		pvs		elfdump	\
95		elfedit		crle		moe 		lari \
96		librtld_db	elfwrap
97
98MSGDIR=		messages
99
100
101all :=		TARGET= all
102install :=	TARGET= install
103clean :=	TARGET= clean
104clobber :=	TARGET= clobber
105delete :=	TARGET= delete
106lint :=		TARGET= lint
107_msg :=		TARGET= catalog
108_msg_gettext :=	TARGET= catalog
109_msg_sgsmsg :=	TARGET= catalog
110chkmsg :=	TARGET= chkmsg
111
112
113.KEEP_STATE:
114
115.PARALLEL:	$(SUBDIRS)
116
117all install:	native-add .WAIT $(SUBDIRS)
118
119include		$(SRC)/cmd/Makefile.targ
120
121# Messaging support
122#
123_msg: _msg_gettext _msg_sgsmsg
124
125_msg_gettext: $(MSGDOMAIN)/$(POFILE)
126
127_msg_sgsmsg: $(MSGDIR)
128
129$(MSGDOMAIN)/$(POFILE): \
130		$(MSGDOMAIN) $(POFILE)
131
132$(POFILE):	$(POSUBDIRS)
133		$(RM) $(POFILE)
134		cat $(POFILES) > $(POFILE)
135
136$(MSGDIR):	$(MSGSUBDIRS) FRC
137		@ cd $@; pwd; $(MAKE) $(TARGET)
138
139chkmsg:		libconv $(MSGSUBDIRS) FRC
140
141# built from lib/Makefile
142install_lib:	FRC
143		@ cd lex; pwd; $(MAKE) $@
144		@ cd yacc; pwd; $(MAKE) $@
145
146lint:		$(SUBDIRS)
147
148delete \
149clean 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
161native-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
170native-clobber:
171		@ cd tools; pwd; $(MAKE) $(TARGET)
172		$(RM) -r proto/$(MACH)
173
174native-proto:
175		-@mkdir -p proto/$(MACH)
176
177FRC:
178
179#
180# Cross-reference customization: ignore the directories named by XRPRUNE,
181# and tweak the file globs slightly.
182#
183XRPRUNE=	rtld.4.x packages abi
184XRADD=		*.msg mapfile* llib-[a-z]*
185XRDEL=		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#
192XRDIRS=		. \
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
202xref:		FRC
203		@ $(RM) cscope.*
204		xref -p -x cscope
205