xref: /illumos-gate/usr/src/cmd/sgs/Makefile (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
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 2008 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		elfwrap		\
59		error		\
60		gprof		\
61		lari		\
62		lex		\
63		lorder		\
64		m4		\
65		mcs		\
66		moe		\
67		nm		\
68		prof		\
69		ranlib		\
70		size		\
71		symorder	\
72		tsort		\
73		unifdef		\
74		yacc
75
76SUBDIRS-i386=
77SUBDIRS-sparc=	rtld.4.x
78
79SUBDIRS=	$(SUBDIRS-common) $(SUBDIRS-$(MACH))
80
81# Messaging support
82#
83POSUBDIRS=	ar		m4		nm \
84		tsort		yacc
85POFILE=		sgs.po
86POFILES=	$(POSUBDIRS:%=%/%.po)
87
88MSGSUBDIRS=	ld		ldd		libld		liblddbg \
89		libldstab	librtld		rtld		libelf \
90		ldprof		libcrle		pvs		elfdump	\
91		elfedit		crle		moe 		lari \
92		librtld_db	elfwrap
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 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