xref: /illumos-gate/usr/src/cmd/sgs/Makefile (revision 0886dcadf4b2cd677c3b944167f0d16ccb243616)
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# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
26# Copyright 2022 Garrett D'Amore <garrett@damore.org>
27#
28
29include		$(SRC)/cmd/Makefile.cmd
30
31# Note: Why SUBDIRS-common isn't sorted alphabetically
32#
33# The items under SGS are not independent of each other.
34# They must be built in an order that ensures that
35# all dependencies of an item have been built before the
36# item itself.
37#
38SUBDIRS=	 libconv	\
39		.WAIT		\
40		libdl		\
41		libelf		\
42		liblddbg	\
43		.WAIT		\
44		libld		\
45		libldmake	\
46		libldstab	\
47		librtld		\
48		libcrle		\
49		.WAIT		\
50		0@0		\
51		ld		\
52		ldd		\
53		lddstub		\
54		rtld		\
55		link_audit	\
56		.WAIT		\
57		librtld_db	\
58		ldprof		\
59		pvs		\
60		crle		\
61		ar		\
62		dump		\
63		elfcap.chk	\
64		elfdump		\
65		elfedit		\
66		elfwrap		\
67		error		\
68		gprof		\
69		lari		\
70		lex		\
71		lorder		\
72		m4		\
73		mcs		\
74		moe		\
75		nm		\
76		ranlib		\
77		size		\
78		symorder	\
79		tsort		\
80		unifdef		\
81		yacc		\
82		.WAIT		\
83		demo_rdb
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
97CHKSUBDIRS=	elfcap.chk
98
99MSGDIR=		messages
100
101all :=		TARGET= all
102install :=	TARGET= install
103clean :=	TARGET= clean
104clobber :=	TARGET= clobber
105_msg :=		TARGET= catalog
106_msg_gettext :=	TARGET= catalog
107_msg_sgsmsg :=	TARGET= catalog
108chkmsg :=	TARGET= chkmsg
109check :=	TARGET= check
110
111
112.KEEP_STATE:
113
114.PARALLEL:	$(SUBDIRS)
115
116all install:	$(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 $(CHKSUBDIRS)
141
142# built from lib/Makefile
143install_lib:	FRC
144		@ cd lex; pwd; $(MAKE) $@
145		@ cd yacc; pwd; $(MAKE) $@
146
147clean clobber: $(SUBDIRS) $(MSGDIR)
148
149$(SUBDIRS):	FRC
150		@ cd $@; pwd; $(MAKE) $(TARGET)
151
152FRC:
153
154#
155# Cross-reference customization: tweak the file globs slightly.
156#
157XRADD=		*.msg mapfile*
158XRDEL=		Makefile* kobj_*
159
160#
161# Establish a set of directories for xref to search.  As there are duplicates
162# of things like headers, and only one file will be added to the xref database,
163# we want xref to list the source file.
164#
165XRDIRS=		. \
166		../../common/elfcap \
167		../../head \
168		../../uts/common/krtld \
169		../../uts/common/sys \
170		../../uts/sparc/sys \
171		../../uts/sparc/krtld \
172		../../uts/intel/ia32/krtld \
173		../../uts/intel/amd64/krtld
174
175xref:		FRC
176		@ $(RM) cscope.*
177		xref -p -x cscope
178