e83f7ba2c9
. file- and functionality-compatible with previous situation (FreeBSD csu) (with a crt1.o -> crt0.o symlink in /usr/lib) . harmonizes source with netbsd . harmonizes linker invocation (e.g. clang) with netbsd . helpful to get some arm code in there for the arm port project
74 lines
1.6 KiB
Makefile
74 lines
1.6 KiB
Makefile
# $NetBSD: Makefile.inc,v 1.32 2009/12/13 08:52:38 mrg Exp $
|
|
|
|
.if !defined(ELFSIZE)
|
|
ELFSIZE=32
|
|
.endif
|
|
|
|
.include "../../Makefile.inc"
|
|
|
|
CPPFLAGS+= -DLIBC_SCCS -DPIC -DDYNAMIC -DELFSIZE=${ELFSIZE}
|
|
CPPFLAGS+= -I${NETBSDSRCDIR}/libexec/ld.elf_so
|
|
CPPFLAGS+= -I${.CURDIR}/../common_elf
|
|
CPPFLAGS+= -I${NETBSDSRCDIR}/lib/libc/dlfcn
|
|
CPPFLAGS+= -DDWARF2_EH
|
|
CPPFLAGS+= -DJCR
|
|
CPPFLAGS+= -DDSO_HANDLE
|
|
|
|
.if defined(HAVE_GCC) && ${HAVE_GCC} > 3
|
|
CFLAGS+= -fno-unit-at-a-time
|
|
.endif
|
|
|
|
.include <bsd.own.mk>
|
|
|
|
.PATH: ${.CURDIR}/../common_elf
|
|
|
|
SRCS+= crt0.c crti.c crtn.c
|
|
OBJS+= crt0.o gcrt0.o crti.o crtn.o
|
|
.if ${MKPIC} != "no"
|
|
COPTS+= -fPIC
|
|
.endif
|
|
|
|
realall: ${OBJS}
|
|
|
|
crt0.o: crt0.c
|
|
${_MKTARGET_COMPILE}
|
|
${COMPILE.c} -DCRT0 ${.IMPSRC} -o ${.TARGET}.o
|
|
${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
rm -f ${.TARGET}.o
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
.endif
|
|
|
|
# dependant on crt0.o to pick up header dependencies
|
|
gcrt0.o: ${.CURDIR}/crt0.c crt0.o
|
|
${_MKTARGET_COMPILE}
|
|
${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
|
|
${LD} -x -r -o ${.TARGET} ${.TARGET}.o
|
|
rm -f ${.TARGET}.o
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
.endif
|
|
|
|
crti.o: crti.c
|
|
${_MKTARGET_COMPILE}
|
|
${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
|
|
${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
|
rm -f ${.TARGET}.o
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
.endif
|
|
|
|
crtn.o: crtn.c
|
|
${_MKTARGET_COMPILE}
|
|
${COMPILE.c} ${.IMPSRC} -o ${.TARGET}.o
|
|
${LD} -X -r -o ${.TARGET} ${.TARGET}.o
|
|
rm -f ${.TARGET}.o
|
|
.if ${MKSTRIPIDENT} != "no"
|
|
${OBJCOPY} -R .ident ${.TARGET}
|
|
.endif
|
|
|
|
FILES=${OBJS}
|
|
FILESDIR=${LIBDIR}
|
|
CLEANFILES=${OBJS}
|
|
|
|
.include <bsd.prog.mk>
|