xref: /illumos-gate/usr/src/cmd/sgs/Makefile (revision a92282e44f968185a6bba094d1e5fece2da819cf)
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#
27
28include		$(SRC)/cmd/Makefile.cmd
29
30# Note: Why SUBDIRS-common isn't sorted alphabetically
31#
32# The items under SGS are not independent of each other.
33# They must be built in an order that ensures that
34# all dependencies of an item have been built before the
35# item itself.
36#
37SUBDIRS-common= libconv		\
38		.WAIT		\
39		libdl		\
40		libelf		\
41		liblddbg	\
42		.WAIT		\
43		libld		\
44		libldmake	\
45		libldstab	\
46		librtld		\
47		libcrle		\
48		.WAIT		\
49		0@0		\
50		ld		\
51		ldd		\
52		lddstub		\
53		rtld		\
54		link_audit	\
55		.WAIT		\
56		librtld_db	\
57		ldprof		\
58		pvs		\
59		crle		\
60		ar		\
61		dump		\
62		elfdump		\
63		elfedit		\
64		elfwrap		\
65		error		\
66		gprof		\
67		lari		\
68		lex		\
69		lorder		\
70		m4		\
71		mcs		\
72		moe		\
73		nm		\
74		prof		\
75		ranlib		\
76		size		\
77		symorder	\
78		tsort		\
79		unifdef		\
80		yacc		\
81		.WAIT		\
82		demo_rdb
83
84SUBDIRS-i386=
85SUBDIRS-sparc=	rtld.4.x
86
87SUBDIRS=	$(SUBDIRS-common) $(SUBDIRS-$(MACH))
88
89# Messaging support
90#
91POSUBDIRS=	m4		nm	tsort		yacc
92POFILE=		sgs.po
93POFILES=	$(POSUBDIRS:%=%/%.po)
94
95MSGSUBDIRS=	ld		ldd		libld		liblddbg \
96		libldstab	librtld		rtld		libelf \
97		ldprof		libcrle		pvs		elfdump	\
98		elfedit		crle		moe		lari \
99		librtld_db	elfwrap		ar
100
101MSGDIR=		messages
102
103
104all :=		TARGET= all
105install :=	TARGET= install
106clean :=	TARGET= clean
107clobber :=	TARGET= clobber
108delete :=	TARGET= delete
109lint :=		TARGET= lint
110_msg :=		TARGET= catalog
111_msg_gettext :=	TARGET= catalog
112_msg_sgsmsg :=	TARGET= catalog
113chkmsg :=	TARGET= chkmsg
114
115
116.KEEP_STATE:
117
118.PARALLEL:	$(SUBDIRS)
119
120all install:	$(SUBDIRS)
121
122include		$(SRC)/cmd/Makefile.targ
123
124# Messaging support
125#
126_msg: _msg_gettext _msg_sgsmsg
127
128_msg_gettext: $(MSGDOMAIN)/$(POFILE)
129
130_msg_sgsmsg: $(MSGDIR)
131
132$(MSGDOMAIN)/$(POFILE): \
133		$(MSGDOMAIN) $(POFILE)
134
135$(POFILE):	$(POSUBDIRS)
136		$(RM) $(POFILE)
137		cat $(POFILES) > $(POFILE)
138
139$(MSGDIR):	$(MSGSUBDIRS) FRC
140		@ cd $@; pwd; $(MAKE) $(TARGET)
141
142chkmsg:		libconv $(MSGSUBDIRS) FRC
143
144check:		chkmsg
145
146# built from lib/Makefile
147install_lib:	FRC
148		@ cd lex; pwd; $(MAKE) $@
149		@ cd yacc; pwd; $(MAKE) $@
150
151lint:
152
153delete clean clobber: $(SUBDIRS) $(MSGDIR)
154
155$(SUBDIRS):	FRC
156		@ cd $@; pwd; $(MAKE) $(TARGET)
157
158FRC:
159
160#
161# Cross-reference customization: ignore the directories named by XRPRUNE,
162# and tweak the file globs slightly.
163#
164XRPRUNE=	rtld.4.x abi
165XRADD=		*.msg mapfile*
166XRDEL=		Makefile* kobj_*
167
168#
169# Establish a set of directories for xref to search.  As there are duplicates
170# of things like headers, and only one file will be added to the xref database,
171# we want xref to list the source file.
172#
173XRDIRS=		. \
174		../../common/elfcap \
175		../../head \
176		../../uts/common/krtld \
177		../../uts/common/sys \
178		../../uts/sparc/sys \
179		../../uts/sparc/krtld \
180		../../uts/intel/ia32/krtld \
181		../../uts/intel/amd64/krtld
182
183xref:		FRC
184		@ $(RM) cscope.*
185		xref -p -x cscope
186