xref: /titanic_41/usr/src/cmd/sgs/libld/i386/Makefile (revision 70025d765b044c6d8594bb965a2247a61e991a99)
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 2005 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29BASEPLAT=	i386
30
31include		$(SRC)/cmd/sgs/libld/Makefile.com
32COPTFLAG=
33
34LIB64=		libld.so.3
35$(LIB64) :=	SONAME = $(LIB64)
36
37L_MACHSRCS32=	machrel.c machsym.c
38L_MACHSRCS64=	../amd64/machrel.c machsym.c ../amd64/amd64unwind.c \
39		../../tools/common/leb128.c
40
41CHKSRCS =  machrel.c ../amd64/machrel.c ../amd64/amd64unwind.c \
42	    ../../tools/common/leb128.c
43
44PICS64=		$(OBJECTS:%=pics64/%) pics64/amd64unwind.o pics64/leb128.o
45$(PICS64) :=	i386_CFLAGS += $(C_PICFLAGS)
46CTFMERGE_LIB64= $(CTFMERGE) -t -f -L VERSION -o $@ $(PICS64)
47$(PICS64)  :=	CFLAGS += $(CTF_FLAGS)
48$(PICS64)  :=	CFLAGS64 += $(CTF_FLAGS)
49$(PICS64)  :=	CTFCONVERT_POST = $(CTFCONVERT_O)
50$(LIB64)   :=	CTFMERGE_POST = $(CTFMERGE_LIB64)
51$(PICS64) :=	CPPFLAGS +=	-I../../../../uts/intel/amd64/krtld
52$(PICS64) :=	CPPFLAGS += -DELF_TARGET_AMD64
53
54SGSMSGTARG +=	$(SGSMSGINTEL)
55
56.PARALLEL:	$(PICS64)
57
58ROOTFS_DYNLIB64=	$(ROOTFS_LIBDIR)/$(LIB64)
59$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
60
61$(PICS) :=	CPPFLAGS += -I../../../../uts/$(PLAT)/krtld
62$(LINTOUT32) :=	CPPFLAGS += -I../../../../uts/$(PLAT)/krtld
63$(LINTOUT64) :=	CPPFLAGS += -I../../../../uts/$(PLAT)/krtld \
64		-DELF_TARGET_AMD64
65
66.KEEP_STATE:
67
68all:		$(DYNLIB) $(LIBLINKS) $(LIB64)
69
70$(LIB64) $(SGSPROTO)/$(LIB64): \
71		pics64 .WAIT $$(PICS64) $(MAPFILES)
72		$(CC) -o $@ $(GSHARED) $(DYNFLAGS) $(PICS64) $(LDLIBS)
73		$(POST_PROCESS_SO)
74
75native:		$(SGSPROTO)/$(DYNLIB) $(SGSPROTO)/$(LIB64)
76
77native-proto:
78		-@mkdir -p proto/$(MACH) proto/$(MACH64)
79
80
81lint:		$(LINTLIB64) $(LINTOUT64)
82.PARALLEL:	$(LINTOUT32) $(LINTOUT64)
83
84pics64:
85		-@mkdir -p $@
86
87clean: clean64
88
89clean64:
90		-$(RM) $(PICS64)
91
92clobber:	clobber64
93
94clobber64:
95		-$(RM) $(LIB64)
96
97delete:
98		$(RM) $(DYNLIB) $(LIB64)
99
100install \
101package:	all $(ROOTFS_DYNLIB) $(ROOTFS_DYNLIB64)
102
103#
104# Grab 64bit amd64 files for libld.so.3
105#
106pics64/amd64unwind.o: ../amd64/amd64unwind.c
107		$(COMPILE.c) -o $@ -D_ELF64 ../amd64/amd64unwind.c
108		$(POST_PROCESS_O)
109
110pics64/machrel.o: ../amd64/machrel.c
111		$(COMPILE.c) -o $@ -D_ELF64 ../amd64/machrel.c
112		$(POST_PROCESS_O)
113
114include		$(SRC)/cmd/sgs/libld/Makefile.targ
115
116pics64/%.o:	$(SRCBASE)/uts/intel/amd64/krtld/%.c
117		$(COMPILE.c) -o $@ -D_ELF64 $<
118		$(POST_PROCESS_O)
119
120pics/%.o:	$(SRCBASE)/uts/$(PLAT)/krtld/%.c
121		$(COMPILE.c) -o $@ $<
122		$(POST_PROCESS_O)
123