xref: /freebsd/lib/csu/powerpc64/Makefile (revision fe50a38eb029e6e551fef9f6cf6ffa515f1897fa)
1# $FreeBSD$
2
3.PATH: ${.CURDIR}/../common
4
5SRCS=		crt1.c crti.S crtn.S
6OBJS=		${SRCS:N*.h:R:S/$/.o/g}
7OBJS+=		Scrt1.o gcrt1.o
8CFLAGS+=	-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.
16CC:=		gcc
17COMPILER_TYPE:=	gcc
18
19FILES=		${OBJS}
20FILESMODE=	${LIBMODE}
21FILESOWN=	${LIBOWN}
22FILESGRP=	${LIBGRP}
23FILESDIR=	${LIBDIR}
24# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
25.undef LIBRARIES_ONLY
26
27CLEANFILES=	${OBJS}
28CLEANFILES+=	crt1.s gcrt1.s Scrt1.s
29
30# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
31# directly compiled to .o files.
32
33crt1.s: crt1.c
34	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
35	sed ${SED_FIX_NOTE} ${.TARGET}
36
37crt1.o: crt1.s
38	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
39
40gcrt1.s: crt1.c
41	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
42	sed ${SED_FIX_NOTE} ${.TARGET}
43
44gcrt1.o: gcrt1.s
45	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
46
47Scrt1.s: crt1.c
48	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
49	sed ${SED_FIX_NOTE} ${.TARGET}
50
51Scrt1.o: Scrt1.s
52	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
53
54.include <bsd.lib.mk>
55