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