2006-06-03 02:16:18 +04:00
|
|
|
# $NetBSD: Makefile.inc,v 1.27 2006/06/02 22:16:18 mrg 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
|
|
|
|
|
2006-05-13 05:40:34 +04:00
|
|
|
.if ${HAVE_GCC} > 3
|
|
|
|
CFLAGS+= -fno-unit-at-a-time
|
|
|
|
.endif
|
|
|
|
|
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
|
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-11-11 14:32:39 +03:00
|
|
|
# dependant on crt0.o to pick up header dependencies
|
|
|
|
gcrt0.o: ${.CURDIR}/crt0.c crt0.o
|
2003-03-19 07:31:41 +03:00
|
|
|
@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
|
|
|
|
|
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>
|