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