1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
2001-10-27 08:30:36 +00:00
|
|
|
|
2017-01-20 03:52:16 +00:00
|
|
|
.PATH: ${.CURDIR:H}/common
|
1998-03-07 20:27:11 +00:00
|
|
|
|
2009-12-02 16:34:20 +00:00
|
|
|
SRCS= crti.S crtn.S
|
2014-08-19 15:30:56 +00:00
|
|
|
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
|
|
|
|
OBJS+= gcrt1.o crt1.o Scrt1.o
|
2018-10-13 23:52:55 +00:00
|
|
|
CFLAGS+= -I${.CURDIR} -I${.CURDIR:H}/common \
|
2017-01-20 03:52:16 +00:00
|
|
|
-I${SRCTOP}/lib/libc/include
|
2018-10-13 23:52:55 +00:00
|
|
|
CFLAGS+= -DCRT_IRELOC_REL
|
2014-08-19 15:30:56 +00:00
|
|
|
|
2015-09-21 18:39:13 +00:00
|
|
|
FILES= ${OBJS}
|
|
|
|
FILESMODE= ${LIBMODE}
|
|
|
|
FILESOWN= ${LIBOWN}
|
|
|
|
FILESGRP= ${LIBGRP}
|
|
|
|
FILESDIR= ${LIBDIR}
|
2015-09-21 21:44:02 +00:00
|
|
|
# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY.
|
|
|
|
.undef LIBRARIES_ONLY
|
2014-08-19 15:30:56 +00:00
|
|
|
|
|
|
|
CLEANFILES= ${OBJS} crt1_c.o crt1_s.o gcrt1_c.o Scrt1_c.o
|
2011-01-13 20:44:31 +00:00
|
|
|
CLEANFILES+= crt1_c.s gcrt1_c.s Scrt1_c.s
|
2002-05-13 15:28:00 +00:00
|
|
|
|
2011-01-13 20:44:31 +00:00
|
|
|
# See the comment in lib/csu/common/crtbrand.c for the reason crt1_c.c is not
|
|
|
|
# directly compiled to .o files.
|
|
|
|
|
|
|
|
gcrt1_c.s: crt1_c.c
|
|
|
|
${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
2012-03-11 20:04:09 +00:00
|
|
|
sed ${SED_FIX_NOTE} ${.TARGET}
|
2011-01-13 20:44:31 +00:00
|
|
|
|
|
|
|
gcrt1_c.o: gcrt1_c.s
|
2017-04-07 19:53:14 +00:00
|
|
|
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} gcrt1_c.s
|
2009-12-02 16:34:20 +00:00
|
|
|
|
|
|
|
gcrt1.o: gcrt1_c.o crt1_s.o
|
2014-07-26 04:38:09 +00:00
|
|
|
${LD} ${_LDFLAGS} -o gcrt1.o -r crt1_s.o gcrt1_c.o
|
2009-12-02 16:34:20 +00:00
|
|
|
|
2011-01-13 20:44:31 +00:00
|
|
|
crt1_c.s: crt1_c.c
|
|
|
|
${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
2012-03-11 20:04:09 +00:00
|
|
|
sed ${SED_FIX_NOTE} ${.TARGET}
|
2011-01-13 20:44:31 +00:00
|
|
|
|
|
|
|
crt1_c.o: crt1_c.s
|
2017-04-07 19:53:14 +00:00
|
|
|
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} crt1_c.s
|
2011-01-13 20:44:31 +00:00
|
|
|
|
2009-12-02 16:34:20 +00:00
|
|
|
crt1.o: crt1_c.o crt1_s.o
|
2014-07-26 04:38:09 +00:00
|
|
|
${LD} ${_LDFLAGS} -o crt1.o -r crt1_s.o crt1_c.o
|
2015-04-02 06:58:17 +00:00
|
|
|
${OBJCOPY} --localize-symbol _start1 crt1.o
|
2009-12-02 16:34:20 +00:00
|
|
|
|
2011-01-13 20:44:31 +00:00
|
|
|
Scrt1_c.s: crt1_c.c
|
|
|
|
${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1_c.c
|
2012-03-11 20:04:09 +00:00
|
|
|
sed ${SED_FIX_NOTE} ${.TARGET}
|
2011-01-13 20:44:31 +00:00
|
|
|
|
|
|
|
Scrt1_c.o: Scrt1_c.s
|
2017-04-07 19:53:14 +00:00
|
|
|
${CC} ${CFLAGS:N-g} ${ACFLAGS} -c -o ${.TARGET} Scrt1_c.s
|
2009-12-02 16:34:20 +00:00
|
|
|
|
|
|
|
Scrt1.o: Scrt1_c.o crt1_s.o
|
2014-07-26 04:38:09 +00:00
|
|
|
${LD} ${_LDFLAGS} -o Scrt1.o -r crt1_s.o Scrt1_c.o
|
2015-04-02 06:58:17 +00:00
|
|
|
${OBJCOPY} --localize-symbol _start1 Scrt1.o
|
1998-09-07 23:32:00 +00:00
|
|
|
|
2014-08-19 15:30:56 +00:00
|
|
|
.include <bsd.lib.mk>
|