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