3 .PATH: ${.CURDIR}/../common
5 SRCS= crt1.c crti.S crtn.S
6 OBJS= ${SRCS:N*.h:R:S/$/.o/g}
8 CFLAGS+= -I${.CURDIR}/../common \
9 -I${.CURDIR}/../../libc/include \
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.
22 CLEANFILES+= crt1.s gcrt1.s Scrt1.s
24 # See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not
25 # directly compiled to .o files.
28 ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c
29 sed ${SED_FIX_NOTE} ${.TARGET}
32 ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s
35 ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c
36 sed ${SED_FIX_NOTE} ${.TARGET}
39 ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s
42 ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c
43 sed ${SED_FIX_NOTE} ${.TARGET}
46 ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s
49 ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
50 ${OBJS} ${DESTDIR}${LIBDIR}