xref: /illumos-gate/usr/src/cmd/sgs/Makefile (revision fae4f9e0b50e2f5af5fce78f508f8669dc2b1e48)
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#
25
26include		$(SRC)/cmd/Makefile.cmd
27
28# Note: Why SUBDIRS-common isn't sorted alphabetically
29#
30# The items under SGS are not independent of each other.
31# They must be built in an order that ensures that
32# all dependencies of an item have been built before the
33# item itself.
34#
35SUBDIRS-common= libconv		\
36		.WAIT		\
37		libdl		\
38		libelf		\
39		liblddbg	\
40		.WAIT		\
41		libld		\
42		libldmake	\
43		libldstab	\
44		librtld		\
45		libcrle		\
46		.WAIT		\
47		0@0		\
48		ld		\
49		ldd		\
50		lddstub		\
51		rtld		\
52		link_audit	\
53		.WAIT		\
54		librtld_db	\
55		ldprof		\
56		pvs		\
57		crle		\
58		ar		\
59		dump		\
60		elfdump		\
61		elfedit		\
62		elfwrap		\
63		error		\
64		gprof		\
65		lari		\
66		lex		\
67		lorder		\
68		m4		\
69		mcs		\
70		moe		\
71		nm		\
72		prof		\
73		ranlib		\
74		size		\
75		symorder	\
76		tsort		\
77		unifdef		\
78		yacc
79
80SUBDIRS-i386=
81SUBDIRS-sparc=	rtld.4.x
82
83SUBDIRS=	$(SUBDIRS-common) $(SUBDIRS-$(MACH))
84
85# Messaging support
86#
87POSUBDIRS=	m4		nm	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		elfedit		crle		moe 		lari \
95		librtld_db	elfwrap		ar
96
97MSGDIR=		messages
98
99
100all :=		TARGET= all
101install :=	TARGET= install
102clean :=	TARGET= clean
103clobber :=	TARGET= clobber
104delete :=	TARGET= delete
105lint :=		TARGET= lint
106_msg :=		TARGET= catalog
107_msg_gettext :=	TARGET= catalog
108_msg_sgsmsg :=	TARGET= catalog
109chkmsg :=	TARGET= chkmsg
110
111
112.KEEP_STATE:
113
114.PARALLEL:	$(SUBDIRS)
115
116all install:	native-add .WAIT $(SUBDIRS)
117
118include		$(SRC)/cmd/Makefile.targ
119
120# Messaging support
121#
122_msg: _msg_gettext _msg_sgsmsg
123
124_msg_gettext: $(MSGDOMAIN)/$(POFILE)
125
126_msg_sgsmsg: $(MSGDIR)
127
128$(MSGDOMAIN)/$(POFILE): \
129		$(MSGDOMAIN) $(POFILE)
130
131$(POFILE):	$(POSUBDIRS)
132		$(RM) $(POFILE)
133		cat $(POFILES) > $(POFILE)
134
135$(MSGDIR):	$(MSGSUBDIRS) FRC
136		@ cd $@; pwd; $(MAKE) $(TARGET)
137
138chkmsg:		libconv $(MSGSUBDIRS) FRC
139
140check:		chkmsg
141
142# built from lib/Makefile
143install_lib:	FRC
144		@ cd lex; pwd; $(MAKE) $@
145		@ cd yacc; pwd; $(MAKE) $@
146
147lint:		$(SUBDIRS)
148
149delete \
150clean clobber:	native-clobber .WAIT $(SUBDIRS) $(MSGDIR)
151
152$(SUBDIRS):	FRC
153		@ cd $@; pwd; $(MAKE) $(TARGET)
154
155
156# Integration of ld and ld.so.1 in some developement cycles requires that both
157# of these modules be built using the new ld.  This `native' target allows us
158# to build a local ld which will then be used to build the delivered version of
159# itself and ld.so.1.  Once this new functionality appears in the standard ld
160# this target can be disabled.
161
162native-add:	FRC
163		@ cd tools/$(MACH); pwd; $(MAKE) native
164		@ cd libconv/$(MACH); pwd; $(MAKE)
165		@ cd libelf/$(MACH); pwd; $(MAKE) native
166		@ cd liblddbg/$(MACH); pwd; $(MAKE) native
167		@ cd libldstab/$(MACH); pwd; $(MAKE) native
168		@ cd libld/$(MACH); pwd; $(MAKE) native
169		@ cd ld/$(MACH); pwd; $(MAKE) native
170
171native-clobber:
172		@ cd tools; pwd; $(MAKE) $(TARGET)
173		$(RM) -r 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 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		../../common/elfcap \
192		../../head \
193		../../uts/common/krtld \
194		../../uts/common/sys \
195		../../uts/sparc/sys \
196		../../uts/sparc/krtld \
197		../../uts/intel/ia32/krtld \
198		../../uts/intel/amd64/krtld
199
200xref:		FRC
201		@ $(RM) cscope.*
202		xref -p -x cscope
203