xref: /titanic_41/usr/src/cmd/sgs/libld/Makefile.com (revision fef1e07ef354c2dcda4dc397c33f5a5532432c7a)
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)/lib/libc/inc \
79		    -I$(SRCBASE)/uts/common/krtld -I$(ELFCAP) \
80		    $(VAR_LIBLD_CPPFLAGS)
81LDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) $(LDDBGLIBDIR) $(LDDBG_LIB) \
82		    $(ELFLIBDIR) -lelf $(DLLIB) -lc
83
84LINTFLAGS +=	-u -D_REENTRANT
85LINTFLAGS64 +=	-u -D_REENTRANT
86
87DYNFLAGS +=	$(BDIRECT) $(VERSREF) \
88		$(ZLAZYLOAD) $(MAPOPTS) $(USE_PROTO) '-R$$ORIGIN'
89
90$(VAR_POUND_3)DEFS=
91$(VAR_POUND_3)native:=	MAPOPTS	=
92native:=	DYNFLAGS	+= $(CONVLIBDIR)
93
94BLTDEFS =	msg.h
95BLTDATA =	msg.c
96BLTMESG =	$(SGSMSGDIR)/libld
97
98BLTFILES =	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
99
100SGSMSGCOM =	../common/libld.msg
101SGSMSGSPARC =	../common/libld.sparc.msg
102SGSMSGINTEL =	../common/libld.intel.msg
103SGSMSGTARG =	$(SGSMSGCOM)
104SGSMSGALL =	$(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL)
105
106SGSMSGFLAGS1 =	$(SGSMSGFLAGS) -m $(BLTMESG)
107SGSMSGFLAGS2 =	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libld_msg
108
109CHKSRCS =	$(SRCBASE)/uts/common/krtld/reloc.h \
110		$(COMOBJS32:%32.o=../common/%.c) \
111		$(L_MACHOBJS32:%32.o=../common/%.c) \
112		$(L_MACHOBJS64:%64.o=../common/%.c)
113
114SRCS =		../common/llib-lld
115LIBSRCS =	$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
116		$(E_TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
117		$(COMOBJS:%.o=../common/%.c) \
118		$(AVLOBJS:%.o=$(VAR_AVLDIR)/%.c) \
119		$(BLTDATA)
120
121LINTSRCS =	$(LIBSRCS) ../common/lintsup.c
122LINTSRCS32 =	$(COMOBJS32:%32.o=../common/%.c) \
123		$(L_MACHOBJS32:%32.o=../common/%.c)
124LINTSRCS64 =	$(COMOBJS64:%64.o=../common/%.c) \
125		$(L_MACHOBJS64:%64.o=../common/%.c)
126
127CLEANFILES +=	$(LINTOUTS) $(BLTFILES)
128CLOBBERFILES +=	$(DYNLIB) $(LINTLIBS) $(LIBLINKS)
129
130ROOTFS_DYNLIB =	$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
131