170658Sobrien# $FreeBSD$
270658Sobrien
385595Sobrien.PATH: ${.CURDIR}/../common
485595Sobrien
570658SobrienSRCS=		crt1.c crti.S crtn.S
670658SobrienOBJS=		${SRCS:N*.h:R:S/$/.o/g}
7223599SnwhitehornOBJS+=		Scrt1.o gcrt1.o
8223599SnwhitehornCFLAGS+=	-I${.CURDIR}/../common \
993399Smarkm		-I${.CURDIR}/../../libc/include
1070658Sobrien
1196516Sruall: ${OBJS}
1270658Sobrien
1396530SruCLEANFILES=	${OBJS}
14223599SnwhitehornCLEANFILES+=	crt1.s gcrt1.s Scrt1.s
1596530Sru
16217375Sdim# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
17217375Sdim# directly compiled to .o files.
1870658Sobrien
19217375Sdimcrt1.s: crt1.c
20217375Sdim	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
21217375Sdim	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
22217375Sdim
23217375Sdimcrt1.o: crt1.s
24234726Sdim	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
25217375Sdim
26217375Sdimgcrt1.s: crt1.c
27217375Sdim	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
28217375Sdim	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
29217375Sdim
30217375Sdimgcrt1.o: gcrt1.s
31234726Sdim	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
32217375Sdim
33223599SnwhitehornScrt1.s: crt1.c
34223599Snwhitehorn	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
35223599Snwhitehorn	sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
36223599Snwhitehorn
37223599SnwhitehornScrt1.o: Scrt1.s
38234726Sdim	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
39223599Snwhitehorn
4070658Sobrienrealinstall:
41100872Sru	${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
4296516Sru	    ${OBJS} ${DESTDIR}${LIBDIR}
4370658Sobrien
4470658Sobrien.include <bsd.lib.mk>
45