2003-03-19 19:54:25 +03:00
|
|
|
# $NetBSD: Makefile.inc,v 1.23 2003/03/19 16:54:25 ross Exp $
|
2001-12-31 03:40:11 +03:00
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
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
|
|
|
|
|
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
|
|
|
|
2002-11-26 22:27:09 +03:00
|
|
|
# If using an external toolchain, we expect crtbegin/crtend to be
|
|
|
|
# supplied by that toolchain's run-time support.
|
|
|
|
.if !defined(EXTERNAL_TOOLCHAIN)
|
2003-03-18 22:11:57 +03:00
|
|
|
SRCS+= crtbegin.c crtend.c
|
2002-11-26 22:27:09 +03:00
|
|
|
OBJS+= crtbegin.o crtend.o
|
|
|
|
.if ${MKPIC} != "no"
|
2003-03-19 07:31:41 +03:00
|
|
|
SRCS+= crtbeginS.c crtendS.c
|
2002-11-26 22:27:09 +03:00
|
|
|
OBJS+= crtbeginS.o crtendS.o
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2000-01-22 22:37:57 +03:00
|
|
|
realall: ${OBJS}
|
1999-03-20 03:32:40 +03:00
|
|
|
|
|
|
|
crt0.o: crt0.c
|
2003-03-19 07:31:41 +03:00
|
|
|
@echo "${COMPILE.c} -DCRT0 ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DCRT0 ${.IMPSRC} -o ${.TARGET}.o
|
1999-03-20 03:32:40 +03:00
|
|
|
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2003-03-19 07:31:41 +03:00
|
|
|
gcrt0.o: ${.CURDIR}/crt0.c
|
|
|
|
@echo "${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
|
1999-03-20 03:32:40 +03:00
|
|
|
@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2002-11-26 22:27:09 +03:00
|
|
|
crti.o: crti.c
|
2003-03-19 07:31:41 +03:00
|
|
|
@echo "${COMPILE.c} ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
|
2002-06-06 23:17:01 +04:00
|
|
|
@${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
1999-03-20 03:32:40 +03:00
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2002-11-26 22:27:09 +03:00
|
|
|
crtn.o: crtn.c
|
2003-03-19 07:31:41 +03:00
|
|
|
@echo "${COMPILE.c} ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
|
2002-06-06 23:17:01 +04:00
|
|
|
@${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
2001-12-31 03:11:13 +03:00
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2002-11-26 22:27:09 +03:00
|
|
|
.if !defined(EXTERNAL_TOOLCHAIN)
|
|
|
|
crtbegin.o: crtbegin.c
|
2003-03-19 07:31:41 +03:00
|
|
|
@echo "${COMPILE.c} ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
|
2002-06-06 23:17:01 +04:00
|
|
|
@${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
1999-03-20 03:32:40 +03:00
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2003-03-19 19:54:25 +03:00
|
|
|
crtbeginS.o: crtbeginS.c
|
2003-03-19 07:31:41 +03:00
|
|
|
@echo "${COMPILE.c} -DSHARED ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DSHARED ${.IMPSRC} -o ${.TARGET}.o
|
2002-06-06 23:17:01 +04:00
|
|
|
@${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
2001-12-31 03:11:13 +03:00
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2002-11-26 22:27:09 +03:00
|
|
|
crtend.o: crtend.c
|
2003-03-19 07:31:41 +03:00
|
|
|
@echo "${COMPILE.c} ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
|
2002-11-22 09:44:56 +03:00
|
|
|
@${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
|
|
|
|
2003-03-19 19:54:25 +03:00
|
|
|
crtendS.o: crtendS.c
|
2003-03-19 07:31:41 +03:00
|
|
|
@echo "${COMPILE.c} -DSHARED ${.IMPSRC} -o ${.TARGET}"
|
|
|
|
@${COMPILE.c} -DSHARED ${.IMPSRC} -o ${.TARGET}.o
|
2002-11-22 09:44:56 +03:00
|
|
|
@${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
|
|
|
@rm -f ${.TARGET}.o
|
2002-11-26 22:27:09 +03:00
|
|
|
.endif # ! EXTERNAL_TOOLCHAIN
|
2002-11-22 09:44:56 +03:00
|
|
|
|
1999-04-03 20:39:31 +04:00
|
|
|
FILES=${OBJS}
|
2001-06-07 19:22:49 +04:00
|
|
|
FILESDIR=${LIBDIR}
|
1999-04-03 20:39:31 +04:00
|
|
|
|
1999-03-20 03:32:40 +03:00
|
|
|
.include <bsd.prog.mk>
|