xref: /titanic_44/usr/src/cmd/sgs/libld/amd64/Makefile (revision e824d57f8160a27ac5e650005c7a4f037109c2be)
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 2006 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29E_TOOLOBJS =	leb128.o
30L_MACHOBJS32 =	machrel.intel32.o	machsym.intel32.o
31L_MACHOBJS64 =	machrel.amd64.o		machsym.intel64.o	unwind.amd64.o
32
33include		../Makefile.com
34
35.KEEP_STATE:
36
37ROOTFS_LIBDIR64 = \
38		$(VAR_LIBLD_64_ROOTFS_LIBDIR)
39
40ROOTFS_DYNLIB64 = \
41		$(DYNLIB:%=$(ROOTFS_LIBDIR64)/%)
42
43SGSMSGCHK =	../common/libld.chk.msg
44SGSMSGTARG +=	$(SGSMSGINTEL)
45
46#
47# For cross-compilation, it is necessary to trigger the correct include files
48# (see sys/elf.h).
49#
50ELFTARGET64 =	-DELF_TARGET_AMD64
51ELFTARGET32 =	-DELF_TARGET_386
52
53ELFLIBDIR =	$(ELFLIBDIR64)
54LDDBGLIBDIR =	$(LDDBGLIBDIR64)
55CONVLIBDIR =	$(CONVLIBDIR64)
56
57$(ROOTFS_DYNLIB64) :=	FILEMODE= 755
58
59all:		$(DYNLIB) $(LIBLINKS)
60
61install \
62package:	all $(ROOTFS_DYNLIB64)
63
64include		../Makefile.targ
65include		../../Makefile.sub.64
66
67# Associate ELF32 and ELF64 objects to the appropriate headers.
68
69pics/%32.o :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld
70pics/%64.o :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld
71
72# Associate the various lint targets with the appropriate headers/files.
73
74$(LINTOUT32) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld \
75		    $(ELFTARGET32)
76$(LINTOUT64) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld \
77		    $(ELFTARGET64) -D_ELF64
78$(LINTLIB32) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld \
79		    $(ELFTARGET32)
80$(LINTLIB64) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld \
81		    $(ELFTARGET64) -D_ELF64
82
83LINTSRCS32 +=	$(G_MACHOBJS32:%32.o=$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld/%.c)
84LINTSRCS64 +=	$(G_MACHOBJS64:%64.o=$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld/%.c)
85
86# Compensate chkmsg with the doreloc family.
87
88CHKSRCS +=	$(G_MACHOBJS32:%32.o=$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld/%.c)
89CHKSRCS +=	$(G_MACHOBJS64:%64.o=$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld/%.c)
90
91pics/%32.o: \
92		$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld/%.c
93		$(COMPILE.c) -o $@ $(ELFTARGET32) $<
94		$(POST_PROCESS_O)
95
96pics/%64.o: \
97		$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld/%.c
98		$(COMPILE.c) -o $@ $(ELFTARGET64) -D_ELF64 $<
99		$(POST_PROCESS_O)
100