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