xref: /titanic_52/usr/src/cmd/sgs/libld/Makefile.com (revision 930176a00b697a09f5256ff3d4b1550f8e73c3a6)
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
29LIBRARY =	libld.a
30VERS =		.4
31
32COMOBJS =	debug.o		globals.o	util.o
33
34COMOBJS32 =	args32.o	entry32.o	exit32.o	groups32.o \
35		ldentry32.o	ldlibs32.o	ldmain32.o	libs32.o \
36		files32.o	map32.o		order32.o	outfile32.o \
37		place32.o	relocate32.o	resolve32.o	sections32.o \
38		sunwmove32.o	support32.o	syms32.o	update32.o \
39		version32.o
40
41COMOBJS64 =	args64.o	entry64.o	exit64.o	groups64.o \
42		ldentry64.o	ldlibs64.o	ldmain64.o	libs64.o \
43		files64.o	map64.o		order64.o	outfile64.o \
44		place64.o	relocate64.o	resolve64.o	sections64.o \
45		sunwmove64.o	support64.o	syms64.o	update64.o \
46		version64.o
47
48TOOLOBJS =	alist.o		assfail.o	findprime.o	string_table.o \
49		strhash.o
50AVLOBJ =	avl.o
51
52G_MACHOBJS32 =	doreloc32.o
53G_MACHOBJS64 =	doreloc64.o
54
55BLTOBJ =	msg.o
56ELFCAPOBJ =	elfcap.o
57
58OBJECTS =	$(BLTOBJ) $(G_MACHOBJS32) $(G_MACHOBJS64) \
59		$(L_MACHOBJS32) $(L_MACHOBJS64) \
60		$(COMOBJS) $(COMOBJS32) $(COMOBJS64) \
61		$(TOOLOBJS) $(E_TOOLOBJS) $(AVLOBJ) $(ELFCAPOBJ)
62
63include 	$(SRC)/lib/Makefile.lib
64include 	$(SRC)/cmd/sgs/Makefile.com
65
66MAPFILES=	../common/mapfile-vers
67MAPOPTS=	$(MAPFILES:%=-M%)
68
69ELFCAP=		$(SRC)/common/elfcap
70
71# Building SUNWonld results in a call to the `package' target.  Requirements
72# needed to run this application on older releases are established:
73#   dlopen/dlclose requires libdl.so.1 prior to 5.10
74#
75DLLIB =		$(VAR_DL_LIB)
76package	:=	DLLIB = $(VAR_PKG_DL_LIB)
77
78CPPFLAGS +=	-DUSE_LIBLD_MALLOC -I$(SRCBASE)/uts/common/krtld \
79		    -I$(ELFCAP) $(VAR_LIBLD_CPPFLAGS)
80LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) $(LDDBGLIBDIR) $(LDDBG_LIB) \
81		    $(ELFLIBDIR) -lelf $(DLLIB) -lc
82
83LINTFLAGS +=	-u -D_REENTRANT
84LINTFLAGS64 +=	-u -D_REENTRANT
85
86DYNFLAGS +=	$(BDIRECT) $(VERSREF) \
87		$(ZLAZYLOAD) $(MAPOPTS) $(USE_PROTO) '-R$$ORIGIN'
88
89$(VAR_POUND_3)DEFS=
90$(VAR_POUND_3)native:=	MAPOPTS	=
91native:=	DYNFLAGS	+= $(CONVLIBDIR)
92
93BLTDEFS =	msg.h
94BLTDATA =	msg.c
95BLTMESG =	$(SGSMSGDIR)/libld
96
97BLTFILES =	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
98
99SGSMSGCOM =	../common/libld.msg
100SGSMSGSPARC =	../common/libld.sparc.msg
101SGSMSGINTEL =	../common/libld.intel.msg
102SGSMSGTARG =	$(SGSMSGCOM)
103SGSMSGALL =	$(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL)
104
105SGSMSGFLAGS1 =	$(SGSMSGFLAGS) -m $(BLTMESG)
106SGSMSGFLAGS2 =	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libld_msg
107
108CHKSRCS =	$(SRCBASE)/uts/common/krtld/reloc.h \
109		$(COMOBJS32:%32.o=../common/%.c) \
110		$(L_MACHOBJS32:%32.o=../common/%.c) \
111		$(L_MACHOBJS64:%64.o=../common/%.c)
112
113SRCS =		../common/llib-lld
114LIBSRCS =	$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
115		$(E_TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
116		$(COMOBJS:%.o=../common/%.c) \
117		$(AVLOBJS:%.o=$(VAR_AVLDIR)/%.c) \
118		$(BLTDATA)
119
120LINTSRCS =	$(LIBSRCS) ../common/lintsup.c
121LINTSRCS32 =	$(COMOBJS32:%32.o=../common/%.c) \
122		$(L_MACHOBJS32:%32.o=../common/%.c)
123LINTSRCS64 =	$(COMOBJS64:%64.o=../common/%.c) \
124		$(L_MACHOBJS64:%64.o=../common/%.c)
125
126CLEANFILES +=	$(LINTOUTS) $(BLTFILES)
127CLOBBERFILES +=	$(DYNLIB) $(LINTLIBS) $(LIBLINKS)
128
129ROOTFS_DYNLIB =	$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
130