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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23 #
24 # Copyright 2010 Nexenta Systems, Inc. All rights reserved.
25 # Use is subject to license terms.
26 #
27
28 LIBBASENAME= libc
29 LIBRARY= $(LIBBASENAME:%=%.a)
30 VERS= .1
31
32 # Note that we build libc_pic.a for the benefit of building
33 # ld.so.1, but we do not install it. Only ld.so.1 needs it
34 # and it must be built in the same workspace as libc.
35 LIB_PIC= libc_pic.a
36
37 ROOTLIB= $(ROOT)/usr/lib
38 ROOTFS_LIB= $(ROOT)/lib
39 ROOTLIB64= $(ROOTLIB)/$(MACH64)
40 ROOTFS_LIB64= $(ROOTFS_LIB)/$(MACH64)
41
42 ROOTVARIANTDIR= $(ROOTLIB)/libc
43 ROOTVARIANTDIR64= $(ROOTLIB64)/libc
44
45 ROOTFS_LINTDIR= $(ROOTFS_LIB)
46 ROOTFS_LINTDIR64= $(ROOTFS_LIB64)
112
113 # install rules for install_h target
114 $(ROOTHDRDIR)/%: port/gen/%
115 $(INS.file)
116
117 $(ROOTLIBDIR)/$(DYNLIB) := FILEMODE = 755
118 $(ROOTLIBDIR64)/$(DYNLIB) := FILEMODE = 755
119 $(ROOTFS_LIBDIR)/$(DYNLIB) := FILEMODE = 755
120 $(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755
121
122 $(ROOTVARIANTDIR) := FILEMODE= 755
123 $(ROOTVARIANTDIR)/$(VAR1_DYNLIB) := FILEMODE= 755
124 $(ROOTVARIANTDIR)/$(VAR2_DYNLIB) := FILEMODE= 755
125 $(ROOTVARIANTDIR)/$(VAR3_DYNLIB) := FILEMODE= 755
126
127 $(ROOTVARIANTDIR64) := FILEMODE= 755
128 $(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64) := FILEMODE= 755
129
130 .KEEP_STATE:
131
132 all: all_h lib32 $(BUILD64) .WAIT lib64 .WAIT etc THIRDPARTYLICENSE
133
134 THIRDPARTYLICENSE: extract-copyright
135 $(RM) $@
136 ./extract-copyright . > $@
137
138 etc: $($(MACH)_ETC)
139
140 lib32: $(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
141 @if $(ELFDUMP) -r $(MACH)/$(DYNLIB) | $(GREP) -w environ ; then \
142 $(ECHO) "Error: Invalid reference to environ" ; \
143 $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
144 exit 1; \
145 fi
146
147 lib64: $(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS64)
148 @if $(ELFDUMP) -r $(MACH64)/$(DYNLIB) | $(GREP) -w environ ; then \
149 $(ECHO) "Error: Invalid reference to environ" ; \
150 $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
151 exit 1; \
152 fi
153
154 $(MACH)/assym.h $(MACH64)/assym.h:
155 @cd $(@D); $(MAKE) assym.h
156
157 $(VARIANTLIBS): FRC
158 @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
159
160 $(VARIANTLIBS64): FRC
161 @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
162
163 $($(MACH)_ETC): FRC
164 @cd $(@); pwd; $(MAKE) $(TARGET)
165
166 $($(MACH)_COMP): FRC
167 @cd $(@); pwd; $(MAKE) $(TARGET)
168
169 install: all \
170 etc \
171 inslib32 \
172 $(BUILD64) inslib64
173
174 inslib32: $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) \
175 $(ROOTFS_LINTLIB) \
176 $(ROOTVARIANTLIBS)
177
178 inslib64: $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \
179 $(ROOTFS_LINTLIB64) \
180 $(ROOTVARIANTLIBS64)
181
182 install_h: all_h $(ROOTHDRS)
183
184 all_h: $(MACH)/assym.h $(MACH64)/assym.h
185
186 check: $(CHECKHDRS)
187
188 $(ROOTFS_LIB)/%: $(MACH)/%
189 $(INS.file)
190 $(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS)
191 $(INS.liblink)
192 $(ROOTFS_LIB64)/%: $(MACH64)/%
193 $(INS.file)
194 $(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
195 $(INS.liblink)
196
197 $(ROOTVARIANTDIR): $(ROOTLIB)
198 $(INS.dir)
199 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
200 $(INS.file)
201 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
202 $(INS.file)
203 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR3_BLDDIR)/%
204 $(INS.file)
|
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 (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
23 #
24 # Copyright 2010 Nexenta Systems, Inc. All rights reserved.
25 # Use is subject to license terms.
26 #
27 # Copyright 2014 Andrew Stormont.
28 #
29
30 LIBBASENAME= libc
31 LIBRARY= $(LIBBASENAME:%=%.a)
32 VERS= .1
33
34 # Note that we build libc_pic.a for the benefit of building
35 # ld.so.1, but we do not install it. Only ld.so.1 needs it
36 # and it must be built in the same workspace as libc.
37 LIB_PIC= libc_pic.a
38
39 ROOTLIB= $(ROOT)/usr/lib
40 ROOTFS_LIB= $(ROOT)/lib
41 ROOTLIB64= $(ROOTLIB)/$(MACH64)
42 ROOTFS_LIB64= $(ROOTFS_LIB)/$(MACH64)
43
44 ROOTVARIANTDIR= $(ROOTLIB)/libc
45 ROOTVARIANTDIR64= $(ROOTLIB64)/libc
46
47 ROOTFS_LINTDIR= $(ROOTFS_LIB)
48 ROOTFS_LINTDIR64= $(ROOTFS_LIB64)
114
115 # install rules for install_h target
116 $(ROOTHDRDIR)/%: port/gen/%
117 $(INS.file)
118
119 $(ROOTLIBDIR)/$(DYNLIB) := FILEMODE = 755
120 $(ROOTLIBDIR64)/$(DYNLIB) := FILEMODE = 755
121 $(ROOTFS_LIBDIR)/$(DYNLIB) := FILEMODE = 755
122 $(ROOTFS_LIBDIR64)/$(DYNLIB) := FILEMODE = 755
123
124 $(ROOTVARIANTDIR) := FILEMODE= 755
125 $(ROOTVARIANTDIR)/$(VAR1_DYNLIB) := FILEMODE= 755
126 $(ROOTVARIANTDIR)/$(VAR2_DYNLIB) := FILEMODE= 755
127 $(ROOTVARIANTDIR)/$(VAR3_DYNLIB) := FILEMODE= 755
128
129 $(ROOTVARIANTDIR64) := FILEMODE= 755
130 $(ROOTVARIANTDIR64)/$(VAR1_DYNLIB64) := FILEMODE= 755
131
132 .KEEP_STATE:
133
134 all: all_h lib .WAIT etc THIRDPARTYLICENSE
135
136 THIRDPARTYLICENSE: extract-copyright
137 $(RM) $@
138 ./extract-copyright . > $@
139
140 etc: $($(MACH)_ETC)
141
142 lib32: $(MACH_COMP) $(MACHLIBS) $(MACH)/$(LIB_PIC) $(VARIANTLIBS)
143 @if $(ELFDUMP) -r $(MACH)/$(DYNLIB) | $(GREP) -w environ ; then \
144 $(ECHO) "Error: Invalid reference to environ" ; \
145 $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
146 exit 1; \
147 fi
148
149 lib64: $(MACH_COMP) $(MACHLIBS64) $(MACH64)/$(LIB_PIC) $(VARIANTLIBS64)
150 @if $(ELFDUMP) -r $(MACH64)/$(DYNLIB) | $(GREP) -w environ ; then \
151 $(ECHO) "Error: Invalid reference to environ" ; \
152 $(ECHO) "Error: See comments in port/gen/env_data.c" ; \
153 exit 1; \
154 fi
155
156 lib: lib32 $(BUILD64) .WAIT lib64
157
158 $(MACH)/assym.h $(MACH64)/assym.h:
159 @cd $(@D); $(MAKE) assym.h
160
161 $(VARIANTLIBS): FRC
162 @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
163
164 $(VARIANTLIBS64): FRC
165 @cd $(@D); pwd; VERSION='$(VERSION)' $(MAKE) $(@F)
166
167 $($(MACH)_ETC): FRC
168 @cd $(@); pwd; $(MAKE) $(TARGET)
169
170 $($(MACH)_COMP): FRC
171 @cd $(@); pwd; $(MAKE) $(TARGET)
172
173 install: all etc inslib
174
175 inslib32: $(ROOTFS_LIBS) $(ROOTFS_LINKS) $(ROOTFS_LINT) \
176 $(ROOTFS_LINTLIB) \
177 $(ROOTVARIANTLIBS)
178
179 inslib64: $(ROOTFS_LIBS64) $(ROOTFS_LINKS64) \
180 $(ROOTFS_LINTLIB64) \
181 $(ROOTVARIANTLIBS64)
182
183 inslib: inslib32 $(BUILD64) inslib64
184
185 install_h: all_h $(ROOTHDRS)
186
187 all_h: $(MACH)/assym.h $(BUILD64) $(MACH64)/assym.h
188
189 check: $(CHECKHDRS)
190
191 $(ROOTFS_LIB)/%: $(MACH)/%
192 $(INS.file)
193 $(ROOTFS_LIBDIR)/$(LIBLINKS): $(ROOTFS_LIBDIR)/$(LIBLINKS)$(VERS)
194 $(INS.liblink)
195 $(ROOTFS_LIB64)/%: $(MACH64)/%
196 $(INS.file)
197 $(ROOTFS_LIBDIR64)/$(LIBLINKS): $(ROOTFS_LIBDIR64)/$(LIBLINKS)$(VERS)
198 $(INS.liblink)
199
200 $(ROOTVARIANTDIR): $(ROOTLIB)
201 $(INS.dir)
202 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR1_BLDDIR)/%
203 $(INS.file)
204 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR2_BLDDIR)/%
205 $(INS.file)
206 $(ROOTVARIANTDIR)/%: $(ROOTVARIANTDIR) $(VAR3_BLDDIR)/%
207 $(INS.file)
|