xref: /titanic_52/usr/src/cmd/sgs/Makefile (revision 694c35faa87b858ecdadfe4fc592615f4eefbb07)
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
25include		$(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#
34SUBDIRS-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
79SUBDIRS-i386=
80SUBDIRS-sparc=	rtld.4.x
81
82SUBDIRS=	$(SUBDIRS-common) $(SUBDIRS-$(MACH))
83
84# Messaging support
85#
86POSUBDIRS=	m4		nm	tsort		yacc
87POFILE=		sgs.po
88POFILES=	$(POSUBDIRS:%=%/%.po)
89
90MSGSUBDIRS=	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
96MSGDIR=		messages
97
98
99all :=		TARGET= all
100install :=	TARGET= install
101clean :=	TARGET= clean
102clobber :=	TARGET= clobber
103delete :=	TARGET= delete
104lint :=		TARGET= lint
105_msg :=		TARGET= catalog
106_msg_gettext :=	TARGET= catalog
107_msg_sgsmsg :=	TARGET= catalog
108chkmsg :=	TARGET= chkmsg
109
110
111.KEEP_STATE:
112
113.PARALLEL:	$(SUBDIRS)
114
115all install:	native-add .WAIT $(SUBDIRS)
116
117include		$(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
137chkmsg:		libconv $(MSGSUBDIRS) FRC
138
139check:		chkmsg
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