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