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/libelf/Makefile.targ
+++ new/usr/src/cmd/sgs/libelf/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 (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 # Copyright 2016 RackTop Systems.
24 24 #
25 25
26 26 objs/%.o \
27 27 pics/%.o: %.c
28 28 $(COMPILE.c) -o $@ $<
29 29 $(POST_PROCESS_O)
30 30
31 31 objs/%64.o \
32 32 pics/%64.o: ../common/%.c
33 33 $(COMPILE.c) -D_ELF64 -o $@ $<
34 34 $(POST_PROCESS_O)
35 35
36 36 objs/%.o \
37 37 pics/%.o: ../misc/%.c
38 38 $(COMPILE.c) -DELF -o $@ $<
39 39 $(POST_PROCESS_O)
40 40
41 41 objs/%.o \
42 42 pics/%.o: ../common/%.c
43 43 $(COMPILE.c) -o $@ $<
44 44 $(POST_PROCESS_O)
45 45
46 46 all: $(BLTSRCS) .WAIT $(LIBS) $(LIBLINKS)
47 47
48 48 install: all .WAIT $(ROOTFS_LIBS) $(ROOTFS_LINKS) \
49 49 $(ROOTFS_LINTLIB) \
50 50 .WAIT $(ROOTDEMODIRS) .WAIT $(ROOTDEMOFILES) \
51 51 $(ROOTFS_LIBDIR)/$(LINTLIBSRC)
52 52
53 53 $(ROOTFS_LIBDIR)/$(LINTLIBSRC): ../common/$(LINTLIBSRC)
54 54 $(VAR_POUND_1) $(INS.file) ../common/$(LINTLIBSRC)
55 55
56 56 lint: $(LINTLIB) $(LINTOUT32) $(LINTOUT64) $(SGSLINTOUT)
57 57
58 58 .PARALLEL: $(LINTOUT32) $(LINTOUT64)
59 59
60 60 delete:
61 61 $(RM) $(DYNLIB)
62 62
63 63 $(LIBLINKS):
64 64 $(RM) $(LIBLINKS)
65 65 $(SYMLINK) $(DYNLIB) $(LIBLINKS)
66 66
67 67 CLOBBERFILES += $(LIBLINKS)
68 68
69 69 # include common library targets
70 70 #
71 71 include $(SRC)/lib/Makefile.targ
72 72 include $(SRC)/cmd/sgs/Makefile.targ
73 73
74 74 xlate.c: ../common/xlate.m4
75 75 $(M4) < ../common/xlate.m4 > xlate.c
76 76
77 77 xlate64.c: ../common/xlate64.m4
78 78 $(M4) < ../common/xlate64.m4 > xlate64.c
79 79
80 80
81 81 objs/msg.o \
82 82 pics/msg.o: msg.c
83 83
84 84 objs/error.o \
85 85 pics/error.o: msg.h
86 86
87 87 objs/ar.o \
88 88 pics/ar.o: msg.h
89 89
90 90 objs/xlate.o \
91 91 pics/xlate.o: xlate.c
92 92
93 93 #
94 94 # Targets needed to support running of Warlock. The old warlock can be
95 95 # located at:
96 96 # suntools.eng:/export/tools/internal/warlock
97 97 #
98 98 # to use add the following to your path:
99 99 # export PATH=/net/suntools.eng/export/tools/internal/warlock/bin:$PATH
100 100 #
101 101 # The newer warlock is at:
102 102 # export PATH=/ws/onnv-gate/public/warlock/$MACH:$PATH
103 103 #
104 104 # This target has value for manual debugging, but is not suitable
105 105 # for production use. For this reason, the necessary rules are commented
106 106 # out with '###'. Remove the comments to use it.
107 107 #
108 108 ###warlock := CFLAGS=
109 109 ###
110 110 ###.PARALLEL: $(WARLOCKFILES)
111 111 ###warlock: wlocks .WAIT warlock_files
112 112 ### warlock -c ../common/libelf.wlcmd $(WARLOCKFILES)
113 113 ###
114 114 ###warlock_files: $(BLTSRCS) .WAIT $(WARLOCKFILES)
115 115 ###
116 116 ###wlocks:
117 117 ### -@mkdir -p $@
118 118 ###
119 119 ###wlocks/%.ll: %.c
120 120 ### wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
121 121 ###
122 122 ###wlocks/%.ll: ../misc/%.c
123 123 ### wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
124 124 ###
125 125 ###wlocks/%.ll: ../common/%.c
126 126 ### wlcc $(CFLAGS) $(CPPFLAGS) -o $@ $<
↓ open down ↓ |
126 lines elided |
↑ open up ↑ |
127 127 ###
128 128 ###wlocks/%64.ll: ../common/%.c
129 129 ### wlcc -D_ELF64 $(CFLAGS) $(CPPFLAGS) -o $@ $<
130 130
131 131
132 132 # Special target for native builds (ie. when we need to build a version of ld
133 133 # to build a version of ld :-).
134 134
135 135 native: $(SGSLIBDIR)/$(LIBLINKS)
136 136
137 -$(SGSLIBDIR)/$(DYNLIB): pics .WAIT $$(PICS)
137 +$(PICS): pics
138 +
139 +$(SGSLIBDIR)/$(DYNLIB): $(PICS) $(SGSLIBDIR)
138 140 $(BUILD.SO)
139 141 $(POST_PROCESS_SO)
140 142
141 143 $(SGSLIBDIR)/$(LIBLINKS): $(SGSLIBDIR)/$(DYNLIB)
142 144 -@$(RM) $(SGSLIBDIR)/$(LIBLINKS)
143 145 $(SYMLINK) $(DYNLIB) $(SGSLIBDIR)/$(LIBLINKS)
144 146
145 147
146 148 # Derived source and header files (messaging). Make sure that the sgsmsg
147 149 # command is constructed - libelf might not be built with the whole sgs.
148 150
149 151 catalog: $(BLTMESG)
150 152
151 153 chkmsg: $(LIBSRCS)
152 154 sh $(CHKMSG) $(CHKMSGFLAGS) $(LIBSRCS)
153 155
154 156 $(BLTDEFS) + \
155 157 $(BLTDATA): $(SGSMSG) $(SGSMSGTARG)
156 158 $(SGSMSG) $(SGSMSGFLAGS2) $(SGSMSGTARG)
157 159
158 160 $(BLTMESG): $(SGSMSG) $(SGSMSGALL) xlate.c xlate64.c
159 161 $(SGSMSG) $(SGSMSGFLAGS1) $(SGSMSGALL)
160 162
161 163 $(SGSMSG): FRC
162 164 @ cd $(SGSTOOLS)/$(MACH); pwd; $(MAKE) catalog
163 165 @ pwd
164 166
165 167 FRC:
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX