Print this page
7627 Build should be smarter about how SGSPROTO is created
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Kim Shrier <kshrier@racktopsystems.com>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/sgs/libld/Makefile.targ
+++ new/usr/src/cmd/sgs/libld/Makefile.targ
1 1 #
2 2 # CDDL HEADER START
3 3 #
4 4 # The contents of this file are subject to the terms of the
5 5 # Common Development and Distribution License (the "License").
6 6 # You may not use this file except in compliance with the License.
7 7 #
8 8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 # or http://www.opensolaris.org/os/licensing.
10 10 # See the License for the specific language governing permissions
11 11 # and limitations under the License.
12 12 #
13 13 # When distributing Covered Code, include this CDDL HEADER in each
14 14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 # If applicable, add the following below this CDDL HEADER, with the
16 16 # fields enclosed by brackets "[]" replaced with your own identifying
17 17 # information: Portions Copyright [yyyy] [name of copyright owner]
18 18 #
19 19 # CDDL HEADER END
20 20 #
21 21 #
22 22 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 23 # Use is subject to license terms.
24 24 #
25 25 # Copyright 2016 RackTop Systems.
26 26 #
27 27
28 28 pics/%.o: ../common/%.c
29 29 $(COMPILE.c) -o $@ $<
30 30 $(POST_PROCESS_O)
31 31
32 32 pics/%32.o: ../common/%.c
33 33 $(COMPILE.c) -o $@ $<
34 34 $(POST_PROCESS_O)
35 35
36 36 pics/%64.o: ../common/%.c
37 37 $(COMPILE.c) -o $@ -D_ELF64 $<
38 38 $(POST_PROCESS_O)
39 39
40 40 pics/%32.o: %.c
41 41 $(COMPILE.c) -o $@ $<
42 42 $(POST_PROCESS_O)
43 43
44 44 pics/%64.o: %.c
45 45 $(COMPILE.c) -o $@ -D_ELF64 $<
46 46 $(POST_PROCESS_O)
47 47
48 48 pics/%.o: $(SGSTOOLS)/common/%.c
49 49 $(COMPILE.c) -o $@ $<
50 50 $(POST_PROCESS_O)
51 51
52 52 pics/%.o: $(VAR_AVLDIR)/%.c
53 53 $(COMPILE.c) -o $@ $<
54 54 $(POST_PROCESS_O)
55 55
56 56 #
57 57 # We use the shared elfcap code under usr/src/common/elfcap
58 58 #
59 59 pics/elfcap.o: $(ELFCAP)/elfcap.c
60 60 $(COMPILE.c) -o $@ $(ELFCAP)/elfcap.c
61 61 $(POST_PROCESS_O)
62 62
63 63 # Rules for compiling the shared relocation engines (doreloc.c) maintained
64 64 # under usr/src/uts. To support cross linking, We compile and link
65 65 # all of these into every copy of libld. Each one requires a separate rule:
66 66 # - The source files are in different subtrees under usr/src/uts
67 67 # - The output file needs to include the platform name to
68 68 # keep the object files from colliding
69 69 # The DO_RELOC_LIBLD definition is needed to generate the libld version
70 70 # of the doreloc code.
71 71 #
72 72 pics/%_x86_32.o: $(KRTLD_I386)/%.c
73 73 $(COMPILE.c) -o $@ -DDO_RELOC_LIBLD $<
74 74 $(POST_PROCESS_O)
75 75
76 76 pics/%_x86_64.o: $(KRTLD_AMD64)/%.c
77 77 $(COMPILE.c) -o $@ -D_ELF64 -DDO_RELOC_LIBLD $<
78 78 $(POST_PROCESS_O)
79 79
80 80 pics/%_sparc_32.o: $(KRTLD_SPARC)/%.c
81 81 $(COMPILE.c) -o $@ -DDO_RELOC_LIBLD $<
82 82 $(POST_PROCESS_O)
83 83
84 84 pics/%_sparc_64.o: \
85 85 $(KRTLD_SPARC)/%.c
86 86 $(COMPILE.c) -o $@ -D_ELF64 -DDO_RELOC_LIBLD $<
87 87 $(POST_PROCESS_O)
88 88
89 89
90 90 $(LIBLINKS):
91 91 $(RM) $@; $(SYMLINK) $(DYNLIB) $@
92 92
93 93 delete:
94 94 $(RM) $(DYNLIB)
95 95
↓ open down ↓ |
95 lines elided |
↑ open up ↑ |
96 96 .PARALLEL: $(LINTOUT32) $(LINTOUT64) $(LINTLIB32) $(LINTLIB64)
97 97
98 98 lint: $(LINTLIB32) $(LINTOUT32) $(LINTLIB64) $(LINTOUT64) \
99 99 .WAIT $(SGSLINTOUT)
100 100
101 101 # Special target for native builds (ie. when we need to build a version of ld
102 102 # to build a version of ld :-).
103 103
104 104 native: $(SGSLIBDIR)/$(LIBLINKS)
105 105
106 -$(SGSLIBDIR)/$(DYNLIB): pics .WAIT $$(PICS)
106 +$(PICS): pics
107 +
108 +$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR)
107 109 $(BUILD.SO)
108 110 $(POST_PROCESS_SO)
109 111
110 112 $(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
111 113 @$(RM) $(SGSLIBDIR)/$(LIBLINKS)
112 114 $(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
113 115
114 116 include $(SRC)/lib/Makefile.targ
115 117 include $(SRC)/cmd/sgs/Makefile.targ
116 118
117 119 # Derived source and header files (messaging).
118 120
119 121 catalog: $(BLTMESG)
120 122
121 123 chkmsg: $(LIBSRCS) $(CHKSRCS)
122 124 sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS) $(CHKSRCS)
123 125
124 126 $(BLTDEFS) + \
125 127 $(BLTDATA): $(SGSMSGTARG)
126 128 $(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG)
127 129
128 130 $(BLTMESG): $(SGSMSGALL)
129 131 $(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL)
↓ open down ↓ |
13 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX