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, Version 1.0 only 6# (the "License"). You may not use this file except in compliance 7# with the License. 8# 9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10# or http://www.opensolaris.org/os/licensing. 11# See the License for the specific language governing permissions 12# and limitations under the License. 13# 14# When distributing Covered Code, include this CDDL HEADER in each 15# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16# If applicable, add the following below this CDDL HEADER, with the 17# fields enclosed by brackets "[]" replaced with your own identifying 18# information: Portions Copyright [yyyy] [name of copyright owner] 19# 20# CDDL HEADER END 21# 22# 23# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 24# Use is subject to license terms. 25# 26# ident "%Z%%M% %I% %E% SMI" 27# 28 29BASEPLAT= sparc 30include $(SRC)/cmd/sgs/libld/Makefile.com 31 32# 33# Share machrel.c with the 32-bit sparc directory since 34# they both need the Elf32 and the Elf64 code. 35# 36L_MACHSRCS32= ../$(MACH)/machrel.c ../$(MACH)/machsym.c 37L_MACHSRCS64= $(L_MACHSRCS32) 38CHKSRCS= $(SRCBASE)/uts/common/krtld/reloc.h $(L_MACHSRCS32) 39 40LIB64= libld.so.3 41$(LIB64) := SONAME = $(LIB64) 42 43DBGLIB = -L ../../liblddbg/$(MACH64) 44ELFLIB = -L ../../libelf/$(MACH64) 45 46CONVLIBDIR= $(CONVLIBDIR64) 47LDDBGLIBDIR= $(LDDBGLIBDIR64) 48ELFLIBDIR= $(ELFLIBDIR64) 49 50LINTFLAGS64 += $(VAR_LINTFLAGS64) 51 52SGSMSGTARG += $(SGSMSGSPARC) 53 54.PARALLEL: $(LINTOUT32) $(LINTOUT64) 55 56PICS64= $(OBJECTS:%=pics64/%) 57$(PICS64) := sparcv9_CFLAGS += -xregs=no%appl -K pic 58CPPFLAGS += -I../../../../uts/sparc/krtld 59CTFMERGE_LIB64= $(CTFMERGE) -t -f -L VERSION -o $@ $(PICS64) 60$(PICS64) := CFLAGS += $(CTF_FLAGS) 61$(PICS64) := CFLAGS64 += $(CTF_FLAGS) 62$(PICS64) := CTFCONVERT_POST = $(CTFCONVERT_O) 63$(LIB64) := CTFMERGE_POST = $(CTFMERGE_LIB64) 64 65.PARALLEL: $(PICS64) 66 67ROOTFS_LIBDIR= $(VAR_LIBLD_64_ROOTFS_LIBDIR) 68ROOTFS_DYNLIB64= $(ROOTFS_LIBDIR)/$(LIB64) 69$(ROOTFS_DYNLIB64) := FILEMODE= 755 70 71.KEEP_STATE: 72 73all: $(DYNLIB) $(LIBLINKS) .WAIT $(LIB64) 74 75$(LIB64) $(SGSPROTO)/$(LIB64): \ 76 pics64 .WAIT $$(PICS64) $(MAPFILES) 77 $(CC) $(sparcv9_XARCH) -o $@ -G $(DYNFLAGS) $(PICS64) $(LDLIBS) 78 $(POST_PROCESS_SO) 79 80lint: $(LINTLIB64) $(LINTOUT64) 81 82# 83# Share machrel.c with the base architecture, since they 84# both need all the Elf32 and Elf64 code. 85# 86pics/machrel.o: ../sparc/machrel.c 87 $(COMPILE.c) -o $@ ../sparc/machrel.c 88 $(POST_PROCESS_O) 89 90pics64/machrel.o: ../sparc/machrel.c 91 $(COMPILE.c) -D_ELF64 -o $@ ../sparc/machrel.c 92 $(POST_PROCESS_O) 93 94pics/machsym.o: ../sparc/machsym.c 95 $(COMPILE.c) -o $@ ../sparc/machsym.c 96 $(POST_PROCESS_O) 97 98pics64/machsym.o: ../sparc/machsym.c 99 $(COMPILE.c) -D_ELF64 -o $@ ../sparc/machsym.c 100 $(POST_PROCESS_O) 101 102native: $(SGSPROTO)/$(DYNLIB) $(SGSPROTO)/$(LIB64) 103 104native-proto: 105 -@mkdir -p proto/$(MACH) proto/$(MACH64) 106 107pics64: 108 -@mkdir -p $@ 109 110 111install package: all $(ROOTFS_DYNLIB) $(ROOTFS_DYNLIB64) 112 113 114clean: clean64 115 116clean64: 117 -$(RM) $(PICS64) 118 119clobber: clobber64 120clobber64: 121 -$(RM) $(LIB64) 122 123delete: 124 $(RM) $(DYNLIB) $(LIB64) 125 126include $(SRC)/cmd/sgs/libld/Makefile.targ 127include ../../Makefile.sub.64 128 129$(LIBLINKS) := DYNLIB=$(LIB64) 130 131pics64/%.o: $(SRCBASE)/uts/sparc/krtld/%.c 132 $(COMPILE.c) -o $@ -D_ELF64 $< 133 $(POST_PROCESS_O) 134 135pics/%.o: $(SRCBASE)/uts/sparc/krtld/%.c 136 $(COMPILE.c) -o $@ $< 137 $(POST_PROCESS_O) 138