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.
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.
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]
22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
25 # Copyright 2016 RackTop Systems.
28 pics/%.o: ../common/%.c
32 pics/%32.o: ../common/%.c
36 pics/%64.o: ../common/%.c
37 $(COMPILE.c) -o $@ -D_ELF64 $<
45 $(COMPILE.c) -o $@ -D_ELF64 $<
48 pics/%.o: $(SGSTOOLS)/common/%.c
52 pics/%.o: $(VAR_AVLDIR)/%.c
57 # We use the shared elfcap code under usr/src/common/elfcap
59 pics/elfcap.o: $(ELFCAP)/elfcap.c
60 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
63 # Rules for compiling the shared relocation engines (doreloc.c) maintained
64 # under usr/src/uts. To support cross linking, We compile and link
65 # all of these into every copy of libld. Each one requires a separate rule:
66 # - The source files are in different subtrees under usr/src/uts
67 # - The output file needs to include the platform name to
68 # keep the object files from colliding
69 # The DO_RELOC_LIBLD definition is needed to generate the libld version
70 # of the doreloc code.
72 pics/%_x86_32.o: $(KRTLD_I386)/%.c
73 $(COMPILE.c) -o $@ -DDO_RELOC_LIBLD $<
76 pics/%_x86_64.o: $(KRTLD_AMD64)/%.c
77 $(COMPILE.c) -o $@ -D_ELF64 -DDO_RELOC_LIBLD $<
80 pics/%_sparc_32.o: $(KRTLD_SPARC)/%.c
81 $(COMPILE.c) -o $@ -DDO_RELOC_LIBLD $<
86 $(COMPILE.c) -o $@ -D_ELF64 -DDO_RELOC_LIBLD $<
91 $(RM) $@; $(SYMLINK) $(DYNLIB) $@
96 # Special target for native builds (ie. when we need to build a version of ld
97 # to build a version of ld :-).
99 native: $(SGSLIBDIR)/$(LIBLINKS)
103 $(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR)
107 $(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
108 @$(RM) $(SGSLIBDIR)/$(LIBLINKS)
109 $(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
111 include $(SRC)/lib/Makefile.targ
112 include $(SRC)/cmd/sgs/Makefile.targ
114 # Derived source and header files (messaging).
118 chkmsg: $(LIBSRCS) $(CHKSRCS)
119 sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS) $(CHKSRCS)
122 $(BLTDATA): $(SGSMSGTARG)
123 $(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG)
125 $(BLTMESG): $(SGSMSGALL)
126 $(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL)