xref: /illumos-gate/usr/src/cmd/sgs/rtld/Makefile.targ (revision 2a1fd0ffe121888d44fdec321c25b53dcfaa9118)
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#
23# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
27#
28
29# Don't generate separate sections for this module
30pics/debugdata.o :=	XFFLAG=
31
32# Since we use RTLD rather than DYNLIB, we must explicitly hook in ctfmerge.
33$(RTLD) :=	CTFMERGE_POST = $(CTFMERGE_LIB)
34
35pics/%.o:	%.s
36		$(BUILD.s)
37		$(POST_PROCESS_O)
38
39pics/%.o:	$(CRTSRCS)/%.s
40		$(BUILD.s)
41		$(POST_PROCESS_O)
42
43pics/%.o:	%.c
44		$(COMPILE.c) -o $@ $<
45		$(POST_PROCESS_O)
46
47pics/%.o:	../common/%.c
48		$(COMPILE.c) -o $@ $<
49		$(POST_PROCESS_O)
50
51pics/%.o:	$(VAR_AVLDIR)/%.c
52		$(COMPILE.c) -o $@ $<
53		$(POST_PROCESS_O)
54
55pics/%.o:	$(VAR_DTRDIR)/%.c
56		$(COMPILE.c) -o $@ $<
57		$(POST_PROCESS_O)
58
59pics/%.o:	$(SGSTOOLS)/common/%.c
60		$(COMPILE.c) -o $@ $<
61		$(POST_PROCESS_O)
62
63pics/%.o:	$(SRCBASE)/uts/$(PLAT)/krtld/%.c
64		$(COMPILE.c) -o $@ $<
65		$(POST_PROCESS_O)
66
67pics/elfcap.o:	$(ELFCAP)/elfcap.c
68		$(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
69		$(POST_PROCESS_O)
70
71$(RTLD):	pics $(PICS) $(CRTS)
72		$(LD_USE_PROTO)ld -o $@ -dy -G $(DYNFLAGS) $(CRTI) $(PICS) \
73		    $(LDLIBS) $(CRTN)
74		$(POST_PROCESS_SO)
75
76delete:
77		-$(RM) $(RTLD)
78
79$(ROOTFS_LIBDIR)/%:	%
80		$(INS.file)
81
82$(ETCLIBDIR)/%:		%
83		$(INS.file)
84
85include		$(SRC)/lib/Makefile.targ
86include		$(SRC)/cmd/sgs/Makefile.targ
87
88# Derived source and header files (messaging).
89
90catalog:	$(BLTMESG)
91
92chkmsg :=	SGSMSGCHK=../common/rtld.chk.msg
93
94chkmsg:		$(SRCS) $(CHKSRCS)
95		sh $(CHKMSG) $(CHKMSGFLAGS) $(SRCS) $(CHKSRCS)
96
97$(BLTDEFS) + \
98$(BLTDATA) :	$(SGSMSGTARG)
99		$(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG)
100
101$(BLTMESG) :	$(SGSMSGALL)
102		$(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL)
103