2008-06-25 21:33:28 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
2009-02-21 15:04:31 +00:00
|
|
|
SSP_CFLAGS=
|
2010-01-02 09:58:07 +00:00
|
|
|
|
2013-04-19 19:45:00 +00:00
|
|
|
NO_WMISSING_VARIABLE_DECLARATIONS=
|
|
|
|
|
2018-10-25 17:39:41 +00:00
|
|
|
.include <src.opts.mk>
|
|
|
|
|
2020-01-31 18:04:04 +00:00
|
|
|
.if !defined(BUILDING_TESTS)
|
2018-10-25 17:39:41 +00:00
|
|
|
|
2020-07-03 00:09:41 +00:00
|
|
|
OBJS+= Scrt1.o crt1.o gcrt1.o
|
2018-10-25 17:39:41 +00:00
|
|
|
OBJS+= crtbegin.o crtbeginS.o crtbeginT.o
|
|
|
|
OBJS+= crtend.o crtendS.o
|
2020-07-03 00:09:41 +00:00
|
|
|
OBJS+= crti.o crtn.o
|
|
|
|
|
2020-07-16 21:58:43 +00:00
|
|
|
CRT1OBJS+= crtbrand.o feature_note.o ignore_init_note.o
|
2018-10-25 17:39:41 +00:00
|
|
|
|
2020-06-15 19:38:48 +00:00
|
|
|
ACFLAGS+= -DLOCORE
|
|
|
|
|
2020-05-11 19:36:38 +00:00
|
|
|
CFLAGS+= -fno-asynchronous-unwind-tables
|
|
|
|
CFLAGS+= -fno-omit-frame-pointer
|
2020-07-03 00:09:41 +00:00
|
|
|
CFLAGS+= -I${.CURDIR:H}/common \
|
|
|
|
-I${SRCTOP}/lib/libc/include
|
2020-05-11 19:36:38 +00:00
|
|
|
|
2018-10-25 17:39:41 +00:00
|
|
|
CFLAGS_CRTS= -DSHARED ${PICFLAG}
|
|
|
|
|
2020-07-03 00:09:41 +00:00
|
|
|
FILES= ${OBJS}
|
|
|
|
FILESMODE= ${LIBMODE}
|
|
|
|
FILESOWN= ${LIBOWN}
|
|
|
|
FILESGRP= ${LIBGRP}
|
|
|
|
FILESDIR= ${LIBDIR}
|
|
|
|
# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
|
|
|
|
.undef LIBRARIES_ONLY
|
|
|
|
|
|
|
|
CLEANFILES+= ${OBJS} ${CRT1OBJS} crt1_c.o gcrt1_c.o Scrt1_c.o
|
2020-07-16 21:58:43 +00:00
|
|
|
CLEANFILES+= crti_s.o
|
2020-07-03 00:09:41 +00:00
|
|
|
|
|
|
|
crt1.o: crt1_c.o ${CRT1OBJS}
|
|
|
|
${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
2020-07-07 18:19:05 +00:00
|
|
|
${OBJCOPY} --localize-symbol _start1 ${.TARGET}
|
2020-07-03 00:09:41 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
gcrt1_c.o: crt1_c.c
|
|
|
|
${CC} ${CFLAGS} -DGCRT -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
|
|
|
|
|
|
|
gcrt1.o: gcrt1_c.o ${CRT1OBJS}
|
|
|
|
${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
|
|
|
|
|
|
|
|
Scrt1_c.o: crt1_c.c
|
|
|
|
${CC} ${CFLAGS} -fPIC -DPIC -c -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
|
|
|
|
|
|
|
Scrt1.o: Scrt1_c.o ${CRT1OBJS}
|
|
|
|
${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
|
|
|
|
.if ${MACHINE_ARCH} == "i386"
|
2020-07-07 18:19:05 +00:00
|
|
|
${OBJCOPY} --localize-symbol _start1 ${.TARGET}
|
2020-07-03 00:09:41 +00:00
|
|
|
.endif
|
|
|
|
|
2018-10-25 17:39:41 +00:00
|
|
|
crtbegin.o: crtbegin.c
|
|
|
|
crtbeginS.o: crtbegin.c
|
|
|
|
crtbeginT.o: crtbegin.c
|
|
|
|
crtend.o: crtend.c
|
|
|
|
crtendS.o: crtend.c
|
|
|
|
|
|
|
|
crtbegin.o crtend.o crtbeginT.o:
|
2019-06-15 17:08:32 +00:00
|
|
|
${CC} ${CFLAGS} -I${.CURDIR} -c -o ${.TARGET} ${.ALLSRC:N*.h:[1]}
|
2018-10-25 17:39:41 +00:00
|
|
|
|
|
|
|
crtbeginS.o crtendS.o:
|
2019-06-15 17:08:32 +00:00
|
|
|
${CC} ${CFLAGS} -I${.CURDIR} ${CFLAGS_CRTS} -c -o ${.TARGET} \
|
|
|
|
${.ALLSRC:N*.h:[1]}
|
2018-10-25 17:39:41 +00:00
|
|
|
|
2020-07-16 21:58:43 +00:00
|
|
|
crti_s.o: crti.S
|
|
|
|
${CC} ${CFLAGS} ${ACFLAGS} -c ${.ALLSRC:M*.S} -o ${.TARGET}
|
|
|
|
|
|
|
|
crti.o: crti_s.o crtbrand.o
|
|
|
|
${LD} ${_LDFLAGS} -o ${.TARGET} -r ${.ALLSRC:M*.o}
|
|
|
|
|
2018-10-25 17:39:41 +00:00
|
|
|
.endif
|
|
|
|
|
2010-03-05 13:29:05 +00:00
|
|
|
.include "../Makefile.inc"
|