Makefile.com revision 11827:d7ef53deac3f
1144091Sdas#
2144091Sdas# CDDL HEADER START
3144091Sdas#
4144091Sdas# The contents of this file are subject to the terms of the
5144091Sdas# Common Development and Distribution License (the "License").
6144091Sdas# You may not use this file except in compliance with the License.
7144091Sdas#
8144091Sdas# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9144091Sdas# or http://www.opensolaris.org/os/licensing.
10144091Sdas# See the License for the specific language governing permissions
11144091Sdas# and limitations under the License.
12144091Sdas#
13144091Sdas# When distributing Covered Code, include this CDDL HEADER in each
14144091Sdas# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15144091Sdas# If applicable, add the following below this CDDL HEADER, with the
16144091Sdas# fields enclosed by brackets "[]" replaced with your own identifying
17144091Sdas# information: Portions Copyright [yyyy] [name of copyright owner]
18144091Sdas#
19144091Sdas# CDDL HEADER END
20144091Sdas#
21144091Sdas
22144091Sdas#
23144091Sdas# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24144091Sdas# Use is subject to license terms.
25144091Sdas#
26144091Sdas
27144091SdasRTLD=		ld.so.1
28144091Sdas
29144091SdasAVLOBJ=		avl.o
30144091SdasDTROBJ=		dtrace_data.o
31144091SdasTOOLOBJS=	alist.o strhash.o
32144091SdasBLTOBJ=		msg.o
33144091SdasELFCAPOBJ=	elfcap.o
34144091SdasOBJECTS=	$(BLTOBJ) \
35144091Sdas		$(AVLOBJ) \
36144091Sdas		$(DTROBJ) \
37144091Sdas		$(TOOLOBJS) \
38144091Sdas		$(ELFCAPOBJ) \
39144091Sdas		$(P_ASOBJS)   $(P_COMOBJS)   $(P_MACHOBJS)   $(G_MACHOBJS)  \
40144091Sdas		$(S_ASOBJS)   $(S_COMOBJS)   $(S_MACHOBJS)   $(CP_MACHOBJS)
41144091Sdas
42144091SdasCOMOBJS=	$(P_COMOBJS)  $(S_COMOBJS)
43144091SdasASOBJS=		$(P_ASOBJS)   $(S_ASOBJS)
44144091SdasMACHOBJS=	$(P_MACHOBJS) $(S_MACHOBJS)
45144091SdasNOCTFOBJS=	$(ASOBJS)
46144091Sdas
47144091Sdasinclude		$(SRC)/lib/Makefile.lib
48144091Sdasinclude		$(SRC)/cmd/sgs/Makefile.com
49144091Sdas
50144091SdasSRCDIR =	../common
51144091SdasELFCAP =	$(SRC)/common/elfcap
52144091SdasPLAT =		$(VAR_PLAT_$(BASEPLAT))
53144091Sdas
54144091Sdas# DTrace needs an executable data segment.
55144091SdasMAPFILE.NED=
56144091Sdas
57144091SdasMAPFILES +=	$(MAPFILE-ORDER) $(MAPFILE-PLAT)
58144091Sdas
59144091Sdas# For the libc/libthread unified world:
60144091Sdas# This library needs to be placed in /lib to allow
61144091Sdas# dlopen() functionality while in single-user mode.
62144091SdasROOTFS_DYNLIB=	$(RTLD:%=$(ROOTFS_LIBDIR)/%)
63144091SdasROOTFS_DYNLIB64=	$(RTLD:%=$(ROOTFS_LIBDIR64)/%)
64144091Sdas
65144091Sdas# For the libc/libthread separated world:
66192760Sattilio# A version of this library needs to be placed in /etc/lib to allow
67217108Skib# dlopen() functionality while in single-user mode.
68217108SkibETCLIBDIR=	$(ROOT)/etc/lib
69ETCDYNLIB=	$(RTLD:%=$(ETCLIBDIR)/%)
70
71ROOTDYNLIB=	$(RTLD:%=$(ROOTFS_LIBDIR)/%)
72ROOTDYNLIB64=	$(RTLD:%=$(ROOTFS_LIBDIR64)/%)
73
74
75FILEMODE =	755
76
77CPPFEATUREMACROS= $(VAR_RTLD_CPPFEATUREMACROS)
78
79CPPFLAGS +=	-I$(SRCBASE)/lib/libc/inc \
80		-I$(SRCBASE)/uts/common/krtld \
81		-I$(SRCBASE)/uts/$(PLAT) \
82		-I$(SRCBASE)/uts/$(PLAT)/krtld \
83		-I$(SRC)/common/sgsrtcid \
84		-I$(ELFCAP) \
85		 $(CPPFEATUREMACROS)
86
87ASFLAGS=	-P -D_ASM $(CPPFLAGS)
88LDLIB =		-L ../../libld/$(MACH)
89RTLDLIB =	-L ../../librtld/$(MACH)
90
91# These definitions require that libc be built in the same workspace
92# as the run-time linker and before the run-time linker is built.
93# This is required for the system's self-consistency in any case.
94CPICLIB =	$(VAR_RTLD_CPICLIB)
95CPICLIB64 =	$(VAR_RTLD_CPICLIB64)
96CLIB =		-lc_pic
97
98LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) \
99		$(CPICLIB) $(CLIB) \
100		$(LDDBGLIBDIR) $(LDDBG_LIB) \
101		$(RTLDLIB) -lrtld \
102		$(LDLIB) $(LD_LIB) 
103
104DYNFLAGS +=	-i -e _rt_boot $(VERSREF) $(ZNODLOPEN) \
105		$(ZINTERPOSE) -zdtrace=dtrace_data '-R$$ORIGIN'
106
107BUILD.s=	$(AS) $(ASFLAGS) $< -o $@
108
109BLTDEFS=	msg.h
110BLTDATA=	msg.c
111BLTMESG=	$(SGSMSGDIR)/rtld
112
113BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
114
115SGSMSGCOM=	../common/rtld.msg
116SGSMSG32=	../common/rtld.32.msg
117SGSMSG64=	../common/rtld.64.msg
118SGSMSGSPARC=	../common/rtld.sparc.msg
119SGSMSGSPARC32=	../common/rtld.sparc32.msg
120SGSMSGSPARC64=	../common/rtld.sparc64.msg
121SGSMSGINTEL=	../common/rtld.intel.msg
122SGSMSGINTEL32=	../common/rtld.intel32.msg
123SGSMSGINTEL64=	../common/rtld.intel64.msg
124SGSMSGCHK=	../common/rtld.chk.msg
125SGSMSGTARG=	$(SGSMSGCOM)
126SGSMSGALL=	$(SGSMSGCOM) $(SGSMSG32) $(SGSMSG64) \
127		$(SGSMSGSPARC) $(SGSMSGSPARC32) $(SGSMSGSPARC64) \
128		$(SGSMSGINTEL) $(SGSMSGINTEL32) $(SGSMSGINTEL64)
129
130SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
131SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n rtld_msg
132
133SRCS=		$(AVLOBJ:%.o=$(VAR_AVLDIR)/%.c) \
134		$(DTROBJ:%.o=$(VAR_DTRDIR)/%.c) \
135		$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
136		$(COMOBJS:%.o=../common/%.c)  $(MACHOBJS:%.o=%.c) $(BLTDATA) \
137		$(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c) \
138		$(CP_MACHOBJS:%.o=../$(MACH)/%.c) \
139		$(ASOBJS:%.o=%.s)
140LINTSRCS=	$(SRCS) ../common/lintsup.c
141
142LINTFLAGS +=	-u -Dsun -D_REENTRANT -erroff=E_EMPTY_TRANSLATION_UNIT \
143		-erroff=E_NAME_DECL_NOT_USED_DEF2
144LINTFLAGS64 +=	-u -D_REENTRANT -erroff=E_CAST_INT_TO_SMALL_INT \
145		-erroff=E_NAME_DECL_NOT_USED_DEF2
146
147CLEANFILES +=	$(LINTOUTS)  $(CRTS)  $(BLTFILES)
148CLOBBERFILES +=	$(RTLD)
149