]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/csu/powerpc64/Makefile
Update to ELF Tool Chain r3475
[FreeBSD/FreeBSD.git] / lib / csu / powerpc64 / Makefile
1 # $FreeBSD$
2
3 .PATH: ${.CURDIR}/../common
4
5 SRCS=           crt1.c crti.S crtn.S
6 OBJS=           ${SRCS:N*.h:R:S/$/.o/g}
7 OBJS+=          Scrt1.o gcrt1.o
8 CFLAGS+=        -I${.CURDIR}/../common \
9                 -I${.CURDIR}/../../libc/include \
10                 -mlongcall
11
12 # XXX: See the log for r232932 as to why the above -mlongcall is needed.  Since
13 # clang doesn't support -mlongcall, and testing shows a clang linked with a
14 # clang-built csu segfaults, this must currently be compiled with gcc.  Once
15 # clang supports -mlongcall, or we get a fixed ld, this can be revisited.
16 .include <bsd.compiler.mk>
17 .if ${COMPILER_TYPE} != "gcc"
18 CC:=            gcc
19 COMPILER_TYPE:= gcc
20 .endif
21
22 FILES=          ${OBJS}
23 FILESMODE=      ${LIBMODE}
24 FILESOWN=       ${LIBOWN}
25 FILESGRP=       ${LIBGRP}
26 FILESDIR=       ${LIBDIR}
27 # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
28 .undef LIBRARIES_ONLY
29
30 CLEANFILES=     ${OBJS}
31 CLEANFILES+=    crt1.s gcrt1.s Scrt1.s
32
33 # See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
34 # directly compiled to .o files.
35
36 crt1.s: crt1.c
37         ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
38         sed ${SED_FIX_NOTE} ${.TARGET}
39
40 crt1.o: crt1.s
41         ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
42
43 gcrt1.s: crt1.c
44         ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
45         sed ${SED_FIX_NOTE} ${.TARGET}
46
47 gcrt1.o: gcrt1.s
48         ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
49
50 Scrt1.s: crt1.c
51         ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
52         sed ${SED_FIX_NOTE} ${.TARGET}
53
54 Scrt1.o: Scrt1.s
55         ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
56
57 .include <bsd.lib.mk>