Makefile revision 269114
1# $FreeBSD: head/lib/csu/i386-elf/Makefile 269114 2014-07-26 04:38:09Z sjg $
2
3.PATH: ${.CURDIR}/../common
4
5SRCS=		crti.S crtn.S
6FILES=		${SRCS:N*.h:R:S/$/.o/g} gcrt1.o crt1.o Scrt1.o
7FILESOWN=	${LIBOWN}
8FILESGRP=	${LIBGRP}
9FILESMODE=	${LIBMODE}
10FILESDIR=	${LIBDIR}
11CFLAGS+=	-I${.CURDIR}/../common \
12		-I${.CURDIR}/../../libc/include
13CLEANFILES=	${FILES} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
14CLEANFILES+=	crt1_c.s gcrt1_c.s Scrt1_c.s
15
16NO_PIE=	yes
17
18# See the comment in lib/csu/common/crtbrand.c for the reason crt1_c.c is not
19# directly compiled to .o files.
20
21gcrt1_c.s: crt1_c.c
22	${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
23	sed ${SED_FIX_NOTE} ${.TARGET}
24
25gcrt1_c.o: gcrt1_c.s
26	${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s
27
28gcrt1.o: gcrt1_c.o crt1_s.o
29	${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
30
31crt1_c.s: crt1_c.c
32	${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
33	sed ${SED_FIX_NOTE} ${.TARGET}
34
35crt1_c.o: crt1_c.s
36	${CC} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s
37
38crt1.o:	crt1_c.o crt1_s.o
39	${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
40	objcopy --localize-symbol _start1 crt1.o
41
42Scrt1_c.s: crt1_c.c
43	${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
44	sed ${SED_FIX_NOTE} ${.TARGET}
45
46Scrt1_c.o: Scrt1_c.s
47	${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s
48
49Scrt1.o: Scrt1_c.o crt1_s.o
50	${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
51	objcopy --localize-symbol _start1 Scrt1.o
52
53.include <bsd.prog.mk>
54