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