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