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