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