150476Speter# $FreeBSD$
234198Sjdp
385594Sobrien.PATH: ${.CURDIR}/../common
485594Sobrien
567811SobrienSRCS=		crt1.c crti.S crtn.S
634198SjdpOBJS=		${SRCS:N*.h:R:S/$/.o/g}
7200038SkibOBJS+=		Scrt1.o gcrt1.o
8117074SruCFLAGS+=	-I${.CURDIR}/../common \
993399Smarkm		-I${.CURDIR}/../../libc/include
10181997SkibCFLAGS+=	-fno-omit-frame-pointer
1134198Sjdp
1296516Sruall: ${OBJS}
1334198Sjdp
1496530SruCLEANFILES=	${OBJS}
15217375SdimCLEANFILES+=	crt1.s gcrt1.s Scrt1.s
1696530Sru
17217375Sdim# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
18217375Sdim# directly compiled to .o files.
1938928Sjdp
20217375Sdimcrt1.s: crt1.c
21217375Sdim	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
22217375Sdim	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
23200038Skib
24217375Sdimcrt1.o: crt1.s
25234726Sdim	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
26217375Sdim
27217375Sdimgcrt1.s: crt1.c
28217375Sdim	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
29217375Sdim	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
30217375Sdim
31217375Sdimgcrt1.o: gcrt1.s
32234726Sdim	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
33217375Sdim
34217375SdimScrt1.s: crt1.c
35217375Sdim	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
36217375Sdim	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
37217375Sdim
38217375SdimScrt1.o: Scrt1.s
39234726Sdim	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
40217375Sdim
4134198Sjdprealinstall:
42100872Sru	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
4396516Sru	    ${OBJS} ${DESTDIR}${LIBDIR}
4434198Sjdp
4534198Sjdp.include <bsd.lib.mk>
46