xref: /illumos-gate/usr/src/cmd/sgs/Makefile (revision dd72704bd9e794056c558153663c739e2012d721)
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		prof		\
77		ranlib		\
78		size		\
79		symorder	\
80		tsort		\
81		unifdef		\
82		yacc		\
83		.WAIT		\
84		demo_rdb
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
98CHKSUBDIRS=	elfcap.chk
99
100MSGDIR=		messages
101
102all :=		TARGET= all
103install :=	TARGET= install
104clean :=	TARGET= clean
105clobber :=	TARGET= clobber
106_msg :=		TARGET= catalog
107_msg_gettext :=	TARGET= catalog
108_msg_sgsmsg :=	TARGET= catalog
109chkmsg :=	TARGET= chkmsg
110check :=	TARGET= check
111
112
113.KEEP_STATE:
114
115.PARALLEL:	$(SUBDIRS)
116
117all install:	$(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_msg_sgsmsg: $(MSGDIR)
128
129$(MSGDOMAIN)/$(POFILE): \
130		$(MSGDOMAIN) $(POFILE)
131
132$(POFILE):	$(POSUBDIRS)
133		$(RM) $(POFILE)
134		cat $(POFILES) > $(POFILE)
135
136$(MSGDIR):	$(MSGSUBDIRS) FRC
137		@ cd $@; pwd; $(MAKE) $(TARGET)
138
139chkmsg:		libconv $(MSGSUBDIRS) FRC
140
141check:		chkmsg $(CHKSUBDIRS)
142
143# built from lib/Makefile
144install_lib:	FRC
145		@ cd lex; pwd; $(MAKE) $@
146		@ cd yacc; pwd; $(MAKE) $@
147
148clean clobber: $(SUBDIRS) $(MSGDIR)
149
150$(SUBDIRS):	FRC
151		@ cd $@; pwd; $(MAKE) $(TARGET)
152
153FRC:
154
155#
156# Cross-reference customization: tweak the file globs slightly.
157#
158XRADD=		*.msg mapfile*
159XRDEL=		Makefile* kobj_*
160
161#
162# Establish a set of directories for xref to search.  As there are duplicates
163# of things like headers, and only one file will be added to the xref database,
164# we want xref to list the source file.
165#
166XRDIRS=		. \
167		../../common/elfcap \
168		../../head \
169		../../uts/common/krtld \
170		../../uts/common/sys \
171		../../uts/sparc/sys \
172		../../uts/sparc/krtld \
173		../../uts/intel/ia32/krtld \
174		../../uts/intel/amd64/krtld
175
176xref:		FRC
177		@ $(RM) cscope.*
178		xref -p -x cscope
179