xref: /illumos-gate/usr/src/cmd/sgs/libld/i386/Makefile (revision 4fceebdf03eeac0d7c58a4f70cc19b00a8c40a73)
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
37SGSMSGCHK =	../common/libld.chk.msg
38SGSMSGTARG +=	$(SGSMSGINTEL)
39
40#
41# For cross-compilation, it is necessary to trigger the correct include files
42# (see sys/elf.h).
43#
44ELFTARGET64 =	-DELF_TARGET_AMD64
45ELFTARGET32 =	-DELF_TARGET_386
46
47all:		$(DYNLIB) $(LIBLINKS)
48
49install \
50package:	all $(ROOTFS_DYNLIB)
51
52include		../Makefile.targ
53
54# Associate ELF32 and ELF64 objects to the appropriate headers.
55
56pics/%32.o :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld
57pics/%64.o :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld
58
59# Associate the various lint targets with the appropriate headers/files.
60
61$(LINTOUT32) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld \
62		    $(ELFTARGET32)
63$(LINTOUT64) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld \
64		    $(ELFTARGET64) -D_ELF64
65$(LINTLIB32) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld \
66		    $(ELFTARGET32)
67$(LINTLIB64) :=	CPPFLAGS += -I$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld \
68		    $(ELFTARGET64) -D_ELF64
69
70LINTSRCS32 +=	$(G_MACHOBJS32:%32.o=$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld/%.c)
71LINTSRCS64 +=	$(G_MACHOBJS64:%64.o=$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld/%.c)
72
73# Compensate chkmsg with the doreloc family.
74
75CHKSRCS +=	$(G_MACHOBJS32:%32.o=$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld/%.c)
76CHKSRCS +=	$(G_MACHOBJS64:%64.o=$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld/%.c)
77
78pics/%32.o: \
79		$(SRCBASE)/uts/$(VAR_PLAT_i386)/krtld/%.c
80		$(COMPILE.c) -o $@ $(ELFTARGET32) $<
81		$(POST_PROCESS_O)
82
83pics/%64.o: \
84		$(SRCBASE)/uts/$(VAR_PLAT_amd64)/krtld/%.c
85		$(COMPILE.c) -o $@ $(ELFTARGET64) -D_ELF64 $<
86		$(POST_PROCESS_O)
87