xref: /titanic_41/usr/src/cmd/sgs/libld/Makefile.com (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
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
29LIBRARY=	libld.a
30VERS=		.2
31
32G_MACHOBJS=	doreloc.o
33L_MACHOBJS= 	machrel.o	machsym.o
34
35TOOLOBJS=	alist.o		assfail.o	findprime.o	string_table.o \
36		strhash.o
37AVLOBJ=		avl.o
38COMOBJS=	entry.o		files.o		globals.o	libs.o \
39		order.o		outfile.o	place.o		relocate.o \
40		resolve.o	sections.o	support.o	sunwmove.o \
41		syms.o		update.o	util.o		version.o \
42		args.o		debug.o		ldentry.o	groups.o \
43		ldlibs.o	ldmain.o	exit.o		map.o
44COMOBJS64=	$(COMOBJS:%.o=%64.o)
45BLTOBJ=		msg.o
46ELFCAPOBJ=	elfcap.o
47
48OBJECTS=	$(BLTOBJ)  $(G_MACHOBJS)  $(L_MACHOBJS)  $(COMOBJS) \
49		$(TOOLOBJS) $(AVLOBJ) $(ELFCAPOBJ)
50
51include 	$(SRC)/lib/Makefile.lib
52include 	$(SRC)/cmd/sgs/Makefile.com
53
54PLAT=		$(VAR_PLAT_$(BASEPLAT))
55MAPFILES=	../common/mapfile-vers
56MAPOPTS=	$(MAPFILES:%=-M%)
57
58ELFCAP=		$(SRC)/common/elfcap
59
60# Building SUNWonld results in a call to the `package' target.  Requirements
61# needed to run this application on older releases are established:
62#   dlopen/dlclose requires libdl.so.1 prior to 5.10
63#
64DLLIB =		$(VAR_DL_LIB)
65package	:=	DLLIB = $(VAR_PKG_DL_LIB)
66
67CPPFLAGS +=	-DUSE_LIBLD_MALLOC -I$(SRCBASE)/uts/common/krtld \
68		-I$(ELFCAP) -D_REENTRANT $(VAR_LIBLD_CPPFLAGS)
69LLDLIBS=	$(LDDBGLIBDIR) $(LDDBG_LIB) $(ELFLIBDIR) -lelf $(DLLIB)
70LDLIBS +=	$(CONVLIBDIR) -lconv $(LLDLIBS) -lc
71LINTFLAGS +=	-u $(LDDBGLIBDIR) $(CONVLIBDIR) \
72		-erroff=E_NAME_DECL_NOT_USED_DEF2
73LINTFLAGS64 +=	-u $(LDDBGLIBDIR64) $(CONVLIBDIR64) \
74		-erroff=E_NAME_DECL_NOT_USED_DEF2 \
75		-erroff=E_CAST_INT_TO_SMALL_INT
76ORIGIN =	'-R$$ORIGIN'
77HSONAME =	-h$(SONAME)
78DYNFLAGS +=	$(BDIRECT) $(VERSREF) \
79		$(ZLAZYLOAD) $(MAPOPTS) $(USE_PROTO) $(ORIGIN)
80
81$(VAR_POUND_3)DEFS=
82$(VAR_POUND_3)native:=	MAPOPTS	=
83native:=	DYNFLAGS	+= $(CONVLIBDIR)
84
85BLTDEFS=	msg.h
86BLTDATA=	msg.c
87BLTMESG=	$(SGSMSGDIR)/libld
88
89BLTFILES=	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
90
91SGSMSGCOM=	../common/libld.msg
92SGSMSGSPARC=	../common/libld.sparc.msg
93SGSMSGINTEL=	../common/libld.intel.msg
94SGSMSGTARG=	$(SGSMSGCOM)
95SGSMSGALL=	$(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL)
96
97SGSMSGFLAGS1=	$(SGSMSGFLAGS) -m $(BLTMESG)
98SGSMSGFLAGS2=	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libld_msg
99
100SRCS=		../common/llib-lld
101LIBSRCS=	$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
102		$(COMOBJS:%.o=../common/%.c) $(BLTDATA) \
103		$(AVLOBJS:%.o=$(VAR_AVLDIR)/%.c) \
104		$(G_MACHOBJS:%.o=$(SRCBASE)/uts/$(PLAT)/krtld/%.c)
105
106LINTSRCS32 = $(L_MACHSRCS32)
107LINTSRCS64 = $(L_MACHSRCS64)
108LINTSRCS = $(LIBSRCS)
109
110CLEANFILES +=	$(LINTOUTS) $(BLTFILES)
111CLOBBERFILES +=	$(DYNLIB) $(LINTLIBS) $(LIBLINKS)
112
113ROOTFS_DYNLIB=	$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
114