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 (the "License"). 6# You may not use this file except in compliance with the License. 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 2009 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# 26 27# libc build rules 28 29# 30# This first rule picks up optimized sources for libc variants. 31# 32pics/%.o: $(OPTIMIZED_LIBCBASE)/gen/%.s 33 $(BUILD.s) 34 $(POST_PROCESS_O) 35 36pics/%.o: $(LIBCBASE)/crt/%.c 37 $(COMPILE.c) -o $@ $< 38 $(POST_PROCESS_O) 39 40pics/%.o: $(LIBCBASE)/crt/%.s 41 $(BUILD.s) 42 $(POST_PROCESS_O) 43 44pics/%.o: $(LIBCBASE)/gen/%.c 45 $(COMPILE.c) -o $@ $< 46 $(POST_PROCESS_O) 47 48pics/%.o: $(LIBCBASE)/gen/%.s 49 $(BUILD.s) 50 $(POST_PROCESS_O) 51 52pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/%.s 53 $(BUILD.s) 54 $(POST_PROCESS_O) 55 56pics/_stack_grow.o: $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s 57 $(BUILD.s) $(LIBCBASE)/../$(TARGET_ARCH)/gen/_stack_grow.s 58 $(POST_PROCESS_O) 59 60pics/%.o: $(LIBCBASE)/fp/%.c 61 $(COMPILE.c) -o $@ $< 62 $(POST_PROCESS_O) 63 64pics/%.o: $(LIBCBASE)/../$(MACH)/fp/%.c 65 $(COMPILE.c) -o $@ $< 66 $(POST_PROCESS_O) 67 68pics/%.o: $(LIBCBASE)/fp/%.s 69 $(BUILD.s) 70 $(POST_PROCESS_O) 71 72pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.c 73 $(COMPILE.c) -o $@ $< 74 $(POST_PROCESS_O) 75 76pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/fp/%.s 77 $(BUILD.s) 78 $(POST_PROCESS_O) 79 80pics/%.o: $(LIBCBASE)/sys/%.c 81 $(COMPILE.c) -o $@ $< 82 $(POST_PROCESS_O) 83 84pics/%.o: $(LIBCBASE)/../common/sys/%.s 85 $(BUILD.s) 86 $(POST_PROCESS_O) 87 88pics/%.o: $(LIBCBASE)/sys/%.s 89 $(BUILD.s) 90 $(POST_PROCESS_O) 91 92pics/%.o: $(LIBCBASE)/../$(MACH)/sys/%.s 93 $(BUILD.s) 94 $(POST_PROCESS_O) 95 96pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.c 97 $(COMPILE.c) -o $@ $< 98 $(POST_PROCESS_O) 99 100pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/sys/%.s 101 $(BUILD.s) 102 $(POST_PROCESS_O) 103 104# rules to build large file aware objects (xxx64.o from xxx.s or xxx.c) 105 106pics/%64.o: $(LIBCBASE)/../common/sys/%.s 107 $(BUILD.s) 108 $(POST_PROCESS_O) 109 110pics/%64.o: $(LIBCBASE)/sys/%.s 111 $(BUILD.s) 112 $(POST_PROCESS_O) 113 114pics/%64.o: $(LIBCBASE)/gen/%.c 115 $(COMPILE.c) -o $@ $< 116 $(POST_PROCESS_O) 117 118pics/%64.o: $(LIBCBASE)/../port/gen/%.c 119 $(COMPILE.c) -o $@ $< 120 $(POST_PROCESS_O) 121 122pics/%64.o: $(LIBCBASE)/../port/sys/%.c 123 $(COMPILE.c) -o $@ $< 124 $(POST_PROCESS_O) 125 126pics/%64.o: $(LIBCBASE)/../port/print/%.c 127 $(COMPILE.c) -o $@ $< 128 $(POST_PROCESS_O) 129 130pics/%64.o: $(LIBCBASE)/../port/stdio/%.c 131 $(COMPILE.c) -o $@ $< 132 $(POST_PROCESS_O) 133 134pics/%_w.o: $(LIBCBASE)/../port/stdio/%.c 135 $(COMPILE.c) -o $@ $< 136 $(POST_PROCESS_O) 137 138pics/%_w.o: $(LIBCBASE)/../port/print/%.c 139 $(COMPILE.c) -o $@ $< 140 $(POST_PROCESS_O) 141 142pics/%_pos.o: $(LIBCBASE)/../port/i18n/%.c 143 $(COMPILE.c) -o $@ $< 144 $(POST_PROCESS_O) 145 146pics/%_sbyte.o: $(LIBCBASE)/../port/i18n/%.c 147 $(COMPILE.c) -o $@ $< 148 $(POST_PROCESS_O) 149 150pics/%_possbyte.o: $(LIBCBASE)/../port/i18n/%.c 151 $(COMPILE.c) -o $@ $< 152 $(POST_PROCESS_O) 153 154pics/%_longlong.o: $(LIBCBASE)/../port/i18n/%.c 155 $(COMPILE.c) -o $@ $< 156 $(POST_PROCESS_O) 157 158# libc build rules for objects built from "portable" source in ../port 159 160pics/%.o: $(LIBCBASE)/../port/fp/%.c 161 $(COMPILE.c) \ 162 -I$(LIBCBASE)/../port/fp -o $@ $< 163 $(POST_PROCESS_O) 164 165pics/%.o: $(LIBCBASE)/../port/i18n/%.c 166 $(COMPILE.c) \ 167 -I$(LIBCBASE)/../port/i18n -o $@ $< 168 $(POST_PROCESS_O) 169 170# gen rules 171pics/%.o %.o: $(LIBCBASE)/../port/gen/%.c 172 $(COMPILE.c) -o $@ $< 173 $(POST_PROCESS_O) 174 175# print rules 176pics/%.o: $(LIBCBASE)/../port/print/%.c 177 $(COMPILE.c) -o $@ $< 178 $(POST_PROCESS_O) 179 180# regex rules 181pics/%.o: $(LIBCBASE)/../port/regex/%.c 182 $(COMPILE.c) -DM_I18N_MB -DI18N \ 183 -I$(LIBCBASE)/../port/regex \ 184 -I$(LIBCBASE)/../port/gen -o $@ $< 185 $(POST_PROCESS_O) 186 187# stdio rules 188pics/%.o: $(LIBCBASE)/../port/stdio/%.c 189 $(COMPILE.c) -o $@ $< 190 $(POST_PROCESS_O) 191 192# c89 print, stdio rules 193pics/%_c89.o: $(LIBCBASE)/../port/print/%.c 194 $(COMPILE.c) -o $@ $< 195 $(POST_PROCESS_O) 196 197pics/%_c89.o: $(LIBCBASE)/../port/stdio/%.c 198 $(COMPILE.c) -o $@ $< 199 $(POST_PROCESS_O) 200 201# aio rules 202pics/%.o: $(LIBCBASE)/../port/aio/%.c 203 $(COMPILE.c) -o $@ $< 204 $(POST_PROCESS_O) 205 206# rt rules 207pics/%.o: $(LIBCBASE)/../port/rt/%.c 208 $(COMPILE.c) -o $@ $< 209 $(POST_PROCESS_O) 210 211# tpool rules 212pics/%.o: $(LIBCBASE)/../port/tpool/%.c 213 $(COMPILE.c) -o $@ $< 214 $(POST_PROCESS_O) 215 216# threads rules 217pics/%.o: $(LIBCBASE)/../port/threads/%.c 218 $(COMPILE.c) -o $@ $< 219 $(POST_PROCESS_O) 220 221pics/%.o: $(LIBCBASE)/threads/%.c 222 $(COMPILE.c) -o $@ $< 223 $(POST_PROCESS_O) 224 225pics/%.o: $(LIBCBASE)/threads/%.s 226 $(BUILD.s) 227 $(POST_PROCESS_O) 228 229pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.c 230 $(COMPILE.c) -o $@ $< 231 $(POST_PROCESS_O) 232 233pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/threads/%.s 234 $(BUILD.s) 235 $(POST_PROCESS_O) 236 237pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.c 238 $(COMPILE.c) -o $@ $< 239 $(POST_PROCESS_O) 240 241pics/%.o: $(LIBCBASE)/../$(TARGET_ARCH)/unwind/%.s 242 $(BUILD.s) 243 $(POST_PROCESS_O) 244 245pics/%.o: $(LIBCBASE)/../port/unwind/%.c 246 $(COMPILE.c) -o $@ $< 247 $(POST_PROCESS_O) 248 249pics/%.o: $(LIBCBASE)/../$(MACH)/unwind/%.s 250 $(BUILD.s) 251 $(POST_PROCESS_O) 252 253pics/%.o: $(LIBCBASE)/../port/sys/%.c 254 $(COMPILE.c) -o $@ $< 255 $(POST_PROCESS_O) 256 257pics/%.o: $(LIBCBASE)/../../common/common/%.c 258 $(COMPILE.c) -o $@ $< 259 $(POST_PROCESS_O) 260 261pics/%.o: $(LIBCBASE)/$(CRTSRCS)/%.s 262 $(BUILD.s) 263 $(POST_PROCESS_O) 264 265# $(SRC)/common rules 266pics/%.o: $(SRC)/common/atomic/$(TARGETMACH)/%.s 267 $(BUILD.s) 268 $(POST_PROCESS_O) 269 270$(COMOBJS:%=pics/%): $(SRC)/common/util/$$(@F:.o=.c) 271 $(COMPILE.c) -o $@ $(SRC)/common/util/$(@F:.o=.c) 272 $(POST_PROCESS_O) 273 274$(XATTROBJS:%=pics/%): $(SRC)/common/xattr/$$(@F:.o=.c) 275 $(COMPILE.c) -o $@ $(SRC)/common/xattr/$(@F:.o=.c) 276 $(POST_PROCESS_O) 277 278$(DTRACEOBJS:%=pics/%): $(SRC)/common/dtrace/$$(@F:.o=.c) 279 $(COMPILE.c) -o $@ $(SRC)/common/dtrace/$(@F:.o=.c) 280 $(POST_PROCESS_O) 281 282$(UNICODEOBJS:%=pics/%): $(SRC)/common/unicode/$$(@F:.o=.c) 283 $(COMPILE.c) -o $@ $(SRC)/common/unicode/$(@F:.o=.c) 284 $(POST_PROCESS_O) 285 286# DTrace rules 287pics/%.o: $(LIBCBASE)/../port/threads/%.d $(THREADSOBJS:%=pics/%) 288 $(COMPILE.d) -C -xlazyload -s $< -o $@ $(THREADSOBJS:%=pics/%) 289 $(POST_PROCESS_O) 290 291include $(SRC)/lib/Makefile.targ 292