xref: /illumos-gate/usr/src/cmd/sgs/Makefile (revision ce17336ed725d3b7fdff67bf0a0ee2b55018fec6)
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-common= 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		elfdump		\
64		elfedit		\
65		elfwrap		\
66		error		\
67		gprof		\
68		lari		\
69		lex		\
70		lorder		\
71		m4		\
72		mcs		\
73		moe		\
74		nm		\
75		prof		\
76		ranlib		\
77		size		\
78		symorder	\
79		tsort		\
80		unifdef		\
81		yacc		\
82		.WAIT		\
83		demo_rdb
84
85SUBDIRS=	$(SUBDIRS-common)
86
87# Messaging support
88#
89POSUBDIRS=	m4		nm	tsort		yacc
90POFILE=		sgs.po
91POFILES=	$(POSUBDIRS:%=%/%.po)
92
93MSGSUBDIRS=	ld		ldd		libld		liblddbg \
94		libldstab	librtld		rtld		libelf \
95		ldprof		libcrle		pvs		elfdump	\
96		elfedit		crle		moe		lari \
97		librtld_db	elfwrap		ar
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
109
110
111.KEEP_STATE:
112
113.PARALLEL:	$(SUBDIRS)
114
115all install:	$(SUBDIRS)
116
117include		$(SRC)/cmd/Makefile.targ
118
119# Messaging support
120#
121_msg: _msg_gettext _msg_sgsmsg
122
123_msg_gettext: $(MSGDOMAIN)/$(POFILE)
124
125_msg_sgsmsg: $(MSGDIR)
126
127$(MSGDOMAIN)/$(POFILE): \
128		$(MSGDOMAIN) $(POFILE)
129
130$(POFILE):	$(POSUBDIRS)
131		$(RM) $(POFILE)
132		cat $(POFILES) > $(POFILE)
133
134$(MSGDIR):	$(MSGSUBDIRS) FRC
135		@ cd $@; pwd; $(MAKE) $(TARGET)
136
137chkmsg:		libconv $(MSGSUBDIRS) FRC
138
139check:		chkmsg
140
141# built from lib/Makefile
142install_lib:	FRC
143		@ cd lex; pwd; $(MAKE) $@
144		@ cd yacc; pwd; $(MAKE) $@
145
146clean clobber: $(SUBDIRS) $(MSGDIR)
147
148$(SUBDIRS):	FRC
149		@ cd $@; pwd; $(MAKE) $(TARGET)
150
151FRC:
152
153#
154# Cross-reference customization: tweak the file globs slightly.
155#
156XRADD=		*.msg mapfile*
157XRDEL=		Makefile* kobj_*
158
159#
160# Establish a set of directories for xref to search.  As there are duplicates
161# of things like headers, and only one file will be added to the xref database,
162# we want xref to list the source file.
163#
164XRDIRS=		. \
165		../../common/elfcap \
166		../../head \
167		../../uts/common/krtld \
168		../../uts/common/sys \
169		../../uts/sparc/sys \
170		../../uts/sparc/krtld \
171		../../uts/intel/ia32/krtld \
172		../../uts/intel/amd64/krtld
173
174xref:		FRC
175		@ $(RM) cscope.*
176		xref -p -x cscope
177