2012-08-04 18:59:05 +04:00
|
|
|
# $NetBSD: Makefile.inc,v 1.35 2012/08/04 14:59:05 matt Exp $
|
1999-03-20 03:32:40 +03:00
|
|
|
|
|
|
|
.if !defined(ELFSIZE)
|
|
|
|
ELFSIZE=32
|
|
|
|
.endif
|
|
|
|
|
2001-11-05 18:11:40 +03:00
|
|
|
.include "../../Makefile.inc"
|
|
|
|
|
1999-03-20 03:32:40 +03:00
|
|
|
CPPFLAGS+= -DLIBC_SCCS -DPIC -DDYNAMIC -DELFSIZE=${ELFSIZE}
|
2002-08-19 13:41:27 +04:00
|
|
|
CPPFLAGS+= -I${NETBSDSRCDIR}/libexec/ld.elf_so
|
1999-03-20 03:32:40 +03:00
|
|
|
CPPFLAGS+= -I${.CURDIR}/../common_elf
|
2002-08-19 13:41:27 +04:00
|
|
|
CPPFLAGS+= -I${NETBSDSRCDIR}/lib/libc/dlfcn
|
2001-08-03 18:26:13 +04:00
|
|
|
CPPFLAGS+= -DDWARF2_EH
|
2001-12-31 02:45:00 +03:00
|
|
|
CPPFLAGS+= -DJCR
|
2001-12-31 03:40:11 +03:00
|
|
|
CPPFLAGS+= -DDSO_HANDLE
|
|
|
|
|
2011-06-20 10:52:36 +04:00
|
|
|
.if defined(HAVE_GCC)
|
2012-08-04 18:59:05 +04:00
|
|
|
COPTS+= -fno-unit-at-a-time
|
2006-05-13 05:40:34 +04:00
|
|
|
.endif
|
|
|
|
|
2009-12-13 11:52:38 +03:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
1999-03-20 03:32:40 +03:00
|
|
|
.PATH: ${.CURDIR}/../common_elf
|
|
|
|
|
2003-03-18 22:11:57 +03:00
|
|
|
SRCS+= crt0.c crti.c crtn.c
|
2002-11-26 22:27:09 +03:00
|
|
|
OBJS+= crt0.o gcrt0.o crti.o crtn.o
|
2002-05-05 04:45:31 +04:00
|
|
|
.if ${MKPIC} != "no"
|
|
|
|
COPTS+= -fPIC
|
|
|
|
.endif
|
1999-03-20 03:32:40 +03:00
|
|
|
|
2000-01-22 22:37:57 +03:00
|
|
|
realall: ${OBJS}
|
1999-03-20 03:32:40 +03:00
|
|
|
|
|
|
|
crt0.o: crt0.c
|
2008-07-21 19:34:58 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
|
|
|
${COMPILE.c} -DCRT0 ${.IMPSRC} -o ${.TARGET}.o
|
|
|
|
${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
rm -f ${.TARGET}.o
|
2009-02-18 18:21:52 +03:00
|
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
|
|
.endif
|
1999-03-20 03:32:40 +03:00
|
|
|
|
2011-07-01 00:09:15 +04:00
|
|
|
# dependent on crt0.o to pick up header dependencies
|
2003-11-11 14:32:39 +03:00
|
|
|
gcrt0.o: ${.CURDIR}/crt0.c crt0.o
|
2008-07-21 19:34:58 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
|
|
|
${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
|
|
|
|
${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
rm -f ${.TARGET}.o
|
2009-02-18 18:21:52 +03:00
|
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
|
|
.endif
|
1999-03-20 03:32:40 +03:00
|
|
|
|
2002-11-26 22:27:09 +03:00
|
|
|
crti.o: crti.c
|
2008-07-21 19:34:58 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2012-08-04 18:59:05 +04:00
|
|
|
${COMPILE.c} -DCRTI ${.IMPSRC} -o ${.TARGET}.o
|
2008-07-21 19:34:58 +04:00
|
|
|
${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
rm -f ${.TARGET}.o
|
2009-02-18 18:21:52 +03:00
|
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
|
|
.endif
|
1999-03-20 03:32:40 +03:00
|
|
|
|
2002-11-26 22:27:09 +03:00
|
|
|
crtn.o: crtn.c
|
2008-07-21 19:34:58 +04:00
|
|
|
${_MKTARGET_COMPILE}
|
2012-08-04 18:59:05 +04:00
|
|
|
${COMPILE.c} -DCRTN ${.IMPSRC} -o ${.TARGET}.o
|
2008-07-21 19:34:58 +04:00
|
|
|
${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
rm -f ${.TARGET}.o
|
2009-02-18 18:21:52 +03:00
|
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
|
|
.endif
|
2001-12-31 03:11:13 +03:00
|
|
|
|
1999-04-03 20:39:31 +04:00
|
|
|
FILES=${OBJS}
|
2001-06-07 19:22:49 +04:00
|
|
|
FILESDIR=${LIBDIR}
|
2007-12-01 14:06:36 +03:00
|
|
|
CLEANFILES=${OBJS}
|
1999-04-03 20:39:31 +04:00
|
|
|
|
1999-03-20 03:32:40 +03:00
|
|
|
.include <bsd.prog.mk>
|