xref: /titanic_41/usr/src/cmd/sgs/libld/Makefile.com (revision 986fd29a0dc13f7608ef7f508f6e700bd7bc2720)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
55aefb655Srie# Common Development and Distribution License (the "License").
65aefb655Srie# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22f3324781Sab196087# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gateLIBRARY =	libld.a
295aefb655SrieVERS =		.4
307c478bd9Sstevel@tonic-gate
315aefb655SrieCOMOBJS =	debug.o		globals.o	util.o
325aefb655Srie
335aefb655SrieCOMOBJS32 =	args32.o	entry32.o	exit32.o	groups32.o \
345aefb655Srie		ldentry32.o	ldlibs32.o	ldmain32.o	libs32.o \
355aefb655Srie		files32.o	map32.o		order32.o	outfile32.o \
365aefb655Srie		place32.o	relocate32.o	resolve32.o	sections32.o \
375aefb655Srie		sunwmove32.o	support32.o	syms32.o	update32.o \
385aefb655Srie		version32.o
395aefb655Srie
405aefb655SrieCOMOBJS64 =	args64.o	entry64.o	exit64.o	groups64.o \
415aefb655Srie		ldentry64.o	ldlibs64.o	ldmain64.o	libs64.o \
425aefb655Srie		files64.o	map64.o		order64.o	outfile64.o \
435aefb655Srie		place64.o	relocate64.o	resolve64.o	sections64.o \
445aefb655Srie		sunwmove64.o	support64.o	syms64.o	update64.o \
455aefb655Srie		version64.o
467c478bd9Sstevel@tonic-gate
477c478bd9Sstevel@tonic-gateTOOLOBJS =	alist.o		assfail.o	findprime.o	string_table.o \
487c478bd9Sstevel@tonic-gate		strhash.o
497c478bd9Sstevel@tonic-gateAVLOBJ =	avl.o
505aefb655Srie
515aefb655SrieG_MACHOBJS32 =	doreloc32.o
525aefb655SrieG_MACHOBJS64 =	doreloc64.o
535aefb655Srie
547c478bd9Sstevel@tonic-gateBLTOBJ =	msg.o
557c478bd9Sstevel@tonic-gateELFCAPOBJ =	elfcap.o
567c478bd9Sstevel@tonic-gate
575aefb655SrieOBJECTS =	$(BLTOBJ) $(G_MACHOBJS32) $(G_MACHOBJS64) \
585aefb655Srie		$(L_MACHOBJS32) $(L_MACHOBJS64) \
595aefb655Srie		$(COMOBJS) $(COMOBJS32) $(COMOBJS64) \
605aefb655Srie		$(TOOLOBJS) $(E_TOOLOBJS) $(AVLOBJ) $(ELFCAPOBJ)
617c478bd9Sstevel@tonic-gate
627c478bd9Sstevel@tonic-gateinclude 	$(SRC)/lib/Makefile.lib
637c478bd9Sstevel@tonic-gateinclude 	$(SRC)/cmd/sgs/Makefile.com
647c478bd9Sstevel@tonic-gate
65f808c858SrafSRCDIR =	../common
667c478bd9Sstevel@tonic-gateELFCAP=		$(SRC)/common/elfcap
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate# Building SUNWonld results in a call to the `package' target.  Requirements
697c478bd9Sstevel@tonic-gate# needed to run this application on older releases are established:
707c478bd9Sstevel@tonic-gate#   dlopen/dlclose requires libdl.so.1 prior to 5.10
717c478bd9Sstevel@tonic-gate#
727c478bd9Sstevel@tonic-gateDLLIB =		$(VAR_DL_LIB)
737c478bd9Sstevel@tonic-gatepackage	:=	DLLIB = $(VAR_PKG_DL_LIB)
747c478bd9Sstevel@tonic-gate
7510a4fa49SrieCPPFLAGS +=	-DUSE_LIBLD_MALLOC -I$(SRCBASE)/lib/libc/inc \
7610a4fa49Srie		    -I$(SRCBASE)/uts/common/krtld -I$(ELFCAP) \
77*986fd29aSsetje		    -I$(SRCBASE)/uts/sparc \
78f3324781Sab196087		    $(VAR_LIBLD_CPPFLAGS) -DDO_RELOC_LIBLD
795aefb655SrieLDLIBS +=	$(CONVLIBDIR) $(CONV_LIB) $(LDDBGLIBDIR) $(LDDBG_LIB) \
805aefb655Srie		    $(ELFLIBDIR) -lelf $(DLLIB) -lc
815aefb655Srie
825aefb655SrieLINTFLAGS +=	-u -D_REENTRANT
835aefb655SrieLINTFLAGS64 +=	-u -D_REENTRANT
845aefb655Srie
857c478bd9Sstevel@tonic-gateDYNFLAGS +=	$(BDIRECT) $(VERSREF) \
86f808c858Sraf		$(ZLAZYLOAD) $(USE_PROTO) '-R$$ORIGIN'
877c478bd9Sstevel@tonic-gate
887c478bd9Sstevel@tonic-gate$(VAR_POUND_3)DEFS=
897c478bd9Sstevel@tonic-gatenative:=	DYNFLAGS	+= $(CONVLIBDIR)
907c478bd9Sstevel@tonic-gate
917c478bd9Sstevel@tonic-gateBLTDEFS =	msg.h
927c478bd9Sstevel@tonic-gateBLTDATA =	msg.c
937c478bd9Sstevel@tonic-gateBLTMESG =	$(SGSMSGDIR)/libld
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gateBLTFILES =	$(BLTDEFS) $(BLTDATA) $(BLTMESG)
967c478bd9Sstevel@tonic-gate
977c478bd9Sstevel@tonic-gateSGSMSGCOM =	../common/libld.msg
987c478bd9Sstevel@tonic-gateSGSMSGSPARC =	../common/libld.sparc.msg
997c478bd9Sstevel@tonic-gateSGSMSGINTEL =	../common/libld.intel.msg
1007c478bd9Sstevel@tonic-gateSGSMSGTARG =	$(SGSMSGCOM)
1017c478bd9Sstevel@tonic-gateSGSMSGALL =	$(SGSMSGCOM) $(SGSMSGSPARC) $(SGSMSGINTEL)
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gateSGSMSGFLAGS1 =	$(SGSMSGFLAGS) -m $(BLTMESG)
1047c478bd9Sstevel@tonic-gateSGSMSGFLAGS2 =	$(SGSMSGFLAGS) -h $(BLTDEFS) -d $(BLTDATA) -n libld_msg
1057c478bd9Sstevel@tonic-gate
1065aefb655SrieCHKSRCS =	$(SRCBASE)/uts/common/krtld/reloc.h \
1075aefb655Srie		$(COMOBJS32:%32.o=../common/%.c) \
1085aefb655Srie		$(L_MACHOBJS32:%32.o=../common/%.c) \
1095aefb655Srie		$(L_MACHOBJS64:%64.o=../common/%.c)
1105aefb655Srie
1117c478bd9Sstevel@tonic-gateSRCS =		../common/llib-lld
1127c478bd9Sstevel@tonic-gateLIBSRCS =	$(TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
1135aefb655Srie		$(E_TOOLOBJS:%.o=$(SGSTOOLS)/common/%.c) \
1145aefb655Srie		$(COMOBJS:%.o=../common/%.c) \
1157c478bd9Sstevel@tonic-gate		$(AVLOBJS:%.o=$(VAR_AVLDIR)/%.c) \
1165aefb655Srie		$(BLTDATA)
1177c478bd9Sstevel@tonic-gate
1185aefb655SrieLINTSRCS =	$(LIBSRCS) ../common/lintsup.c
1195aefb655SrieLINTSRCS32 =	$(COMOBJS32:%32.o=../common/%.c) \
1205aefb655Srie		$(L_MACHOBJS32:%32.o=../common/%.c)
1215aefb655SrieLINTSRCS64 =	$(COMOBJS64:%64.o=../common/%.c) \
1225aefb655Srie		$(L_MACHOBJS64:%64.o=../common/%.c)
1237c478bd9Sstevel@tonic-gate
1247c478bd9Sstevel@tonic-gateCLEANFILES +=	$(LINTOUTS) $(BLTFILES)
1257c478bd9Sstevel@tonic-gateCLOBBERFILES +=	$(DYNLIB) $(LINTLIBS) $(LIBLINKS)
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gateROOTFS_DYNLIB =	$(DYNLIB:%=$(ROOTFS_LIBDIR)/%)
128