xref: /illumos-gate/usr/src/cmd/sgs/Makefile (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29include		$(SRC)/cmd/Makefile.cmd
30
31SUBDIRS-common= libconv		\
32		.WAIT		\
33		libdl		\
34		.WAIT		\
35		libelf		\
36		.WAIT		\
37		liblddbg	\
38		.WAIT		\
39		libld		\
40		libldmake	\
41		libldstab	\
42		librtld		\
43		libcrle		\
44		sgsdemangler	\
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		dis		\
59		dump		\
60		elfdump		\
61		error		\
62		gprof		\
63		lari		\
64		lex		\
65		lorder		\
66		m4		\
67		mapfiles	\
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=	ar		m4		nm \
87		tsort		yacc
88POFILE=		sgs.po
89POFILES=	$(POSUBDIRS:%=%/%.po)
90
91MSGSUBDIRS=	ld		ldd		libld		liblddbg \
92		libldstab	librtld		rtld		libelf \
93		ldprof		libcrle		pvs		elfdump	\
94		crle		moe		lari		librtld_db
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
139# built from lib/Makefile
140install_lib:	FRC
141		@ cd lex; pwd; $(MAKE) $@
142		@ cd yacc; pwd; $(MAKE) $@
143
144lint:		$(SUBDIRS)
145
146delete \
147clean clobber:	native-clobber .WAIT $(SUBDIRS) $(MSGDIR)
148
149$(SUBDIRS):	FRC
150		@ cd $@; pwd; $(MAKE) $(TARGET)
151
152
153# Integration of ld and ld.so.1 in some developement cycles requires that both
154# of these modules be built using the new ld.  This `native' target allows us
155# to build a local ld which will then be used to build the delivered version of
156# itself and ld.so.1.  Once this new functionality appears in the standard ld
157# this target can be disabled.
158
159native-add:	native-proto FRC
160		@ cd tools/$(MACH); pwd; $(MAKE) native
161		@ cd libconv/$(MACH); pwd; $(MAKE)
162		@ cd libelf/$(MACH); pwd; $(MAKE) native
163		@ cd liblddbg/$(MACH); pwd; $(MAKE) native
164		@ cd libldstab/$(MACH); pwd; $(MAKE) native
165		@ cd libld/$(MACH); pwd; $(MAKE) native
166		@ cd ld/$(MACH); pwd; $(MAKE) native
167
168native-clobber:
169		@ cd tools; pwd; $(MAKE) $(TARGET)
170		$(RM) -r proto/$(MACH)
171
172native-proto:
173		-@mkdir -p proto/$(MACH)
174
175FRC:
176
177#
178# Cross-reference customization: ignore the directories named by XRPRUNE,
179# and tweak the file globs slightly.
180#
181XRPRUNE=	rtld.4.x spec packages abi
182XRADD=		*.msg mapfile* llib-[a-z]*
183XRDEL=		Makefile* kobj_*
184
185#
186# Establish a set of directories for xref to search.  As there are duplicates
187# of things like headers, and only one file will be added to the xref database,
188# we want xref to list the source file.
189#
190XRDIRS=		. \
191		../../head \
192		../../uts/common/krtld \
193		../../uts/common/sys \
194		../../uts/sparc/sys \
195		../../uts/sparc/krtld \
196		../../uts/intel/ia32/krtld \
197		../../uts/intel/amd64/krtld
198
199xref:		FRC
200		@ $(RM) cscope.*
201		xref -p -x cscope
202