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