xref: /freebsd/lib/csu/Makefile.inc (revision b0ee263dbd3552d5b1776be0efc1c2d105f873b1)
1# $FreeBSD$
2
3SSP_CFLAGS=
4
5NO_WMISSING_VARIABLE_DECLARATIONS=
6
7.include <src.opts.mk>
8
9.if !defined(BUILDING_TESTS)
10
11OBJS+=	Scrt1.o crt1.o gcrt1.o
12OBJS+=	crtbegin.o crtbeginS.o crtbeginT.o
13OBJS+=	crtend.o crtendS.o
14OBJS+=	crti.o crtn.o
15
16CRT1OBJS+=	crtbrand.o ignore_init_note.o
17
18ACFLAGS+=	-DLOCORE
19
20CFLAGS+=	-fno-asynchronous-unwind-tables
21CFLAGS+=	-fno-omit-frame-pointer
22CFLAGS+=	-I${.CURDIR:H}/common \
23		-I${SRCTOP}/lib/libc/include
24
25CFLAGS_CRTS=	-DSHARED ${PICFLAG}
26
27FILES=		${OBJS}
28FILESMODE=	${LIBMODE}
29FILESOWN=	${LIBOWN}
30FILESGRP=	${LIBGRP}
31FILESDIR=	${LIBDIR}
32# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
33.undef LIBRARIES_ONLY
34
35CLEANFILES+=	${OBJS} ${CRT1OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o
36
37crt1.o:	crt1_c.o ${CRT1OBJS}
38	${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
39.if ${MACHINE_ARCH} == "i386"
40	${OBJCOPY} --localize-symbol _start1 crt1.o
41.endif
42
43gcrt1_c.o: crt1_c.c
44	${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
45
46gcrt1.o: gcrt1_c.o ${CRT1OBJS}
47	${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
48
49Scrt1_c.o: crt1_c.c
50	${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
51
52Scrt1.o: Scrt1_c.o ${CRT1OBJS}
53	${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
54.if ${MACHINE_ARCH} == "i386"
55	${OBJCOPY} --localize-symbol _start1 crt1.o
56.endif
57
58crtbegin.o: crtbegin.c
59crtbeginS.o: crtbegin.c
60crtbeginT.o: crtbegin.c
61crtend.o: crtend.c
62crtendS.o: crtend.c
63
64crtbegin.o crtend.o crtbeginT.o:
65	${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
66
67crtbeginS.o crtendS.o:
68	${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} \
69	    ${.ALLSRC:N*.h:[1]}
70
71.endif
72
73.include "../Makefile.inc"
74