xref: /illumos-gate/usr/src/cmd/sgs/libld/sparc/Makefile (revision 84ab085a13f931bc78e7415e7ce921dbaa14fcb3)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29BASEPLAT=	sparc
30include		$(SRC)/cmd/sgs/libld/Makefile.com
31
32L_MACHSRCS32=	machrel.c machsym.c
33L_MACHSRCS64=	$(L_MACHSRCS32)
34CHKSRCS=	$(SRCBASE)/uts/common/krtld/reloc.h $(L_MACHSRCS32)
35
36LIB64=		libld.so.3
37$(LIB64) :=	SONAME = $(LIB64)
38
39PICS64=		$(OBJECTS:%=pics64/%)
40$(PICS64)  :=	sparc_CFLAGS += -xregs=no%appl -K pic
41$(PICS64)  :=	CFLAGS += $(CTF_FLAGS)
42$(PICS64)  :=	CFLAGS64 += $(CTF_FLAGS)
43$(PICS64)  :=	CTFCONVERT_POST = $(CTFCONVERT_O)
44CTFMERGE_LIB64= $(CTFMERGE) -t -f -L VERSION -o $@ $(PICS64)
45$(LIB64)   :=	CTFMERGE_POST = $(CTFMERGE_LIB64)
46CPPFLAGS +=	-I../../../../uts/sparc/krtld
47
48SGSMSGTARG +=	$(SGSMSGSPARC)
49
50.PARALLEL:	$(PICS64)
51
52ROOTFS_DYNLIB64=	$(ROOTFS_LIBDIR)/$(LIB64)
53$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
54
55.KEEP_STATE:
56
57all:		$(DYNLIB) $(LIBLINKS) .WAIT $(LIB64)
58
59
60$(LIB64) $(SGSPROTO)/$(LIB64): \
61		pics64 .WAIT $$(PICS64) $(MAPFILES)
62		$(CC) -o $@ -G $(DYNFLAGS) $(PICS64) $(LDLIBS)
63		$(POST_PROCESS_SO)
64
65native:		$(SGSPROTO)/$(DYNLIB) $(SGSPROTO)/$(LIB64)
66
67native-proto:
68		-@mkdir -p proto/$(MACH) proto/$(MACH64)
69
70lint:		$(LINTLIB64) $(LINTOUT64)
71.PARALLEL:	$(LINTOUT32) $(LINTOUT64)
72
73pics64:
74		-@mkdir -p $@
75
76install \
77package:	all $(ROOTFS_DYNLIB) $(ROOTFS_DYNLIB64)
78
79
80clean: clean64
81
82clean64:
83		-$(RM) $(PICS64)
84
85clobber:	clobber64
86
87clobber64:
88		-$(RM) $(LIB64)
89
90delete:
91		$(RM) $(DYNLIB) $(LIB64)
92
93
94include		$(SRC)/cmd/sgs/libld/Makefile.targ
95
96pics64/%.o:	$(SRCBASE)/uts/sparc/krtld/%.c
97		$(COMPILE.c) -o $@ -D_ELF64 $<
98		$(POST_PROCESS_O)
99
100pics/%.o:	$(SRCBASE)/uts/sparc/krtld/%.c
101		$(COMPILE.c) -o $@ $<
102		$(POST_PROCESS_O)
103