1 # $NetBSD: Makefile.inc,v 1.2 2010/12/07 19:51:02 joerg Exp $
5 COMMON_DIR:= ${.PARSEDIR}
8 CPPFLAGS+= -I${NETBSDSRCDIR}/libexec/ld.elf_so -I${COMMON_DIR} -I.
10 OBJS+= crt0.o gcrt0.o crti.o crtn.o
11 OBJS+= crtbegin.o crtbeginS.o crtend.o
15 crtbegin.o: crtbegin.S
17 ${COMPILE.S} ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
18 ${LD} -x -r -o ${.TARGET} ${.TARGET}.o
20 .if ${MKSTRIPIDENT} != "no"
21 ${OBJCOPY} -R .ident ${.TARGET}
24 crtbeginS.o: crtbegin.S
26 ${COMPILE.S} -DSHARED ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
27 ${LD} -x -r -o ${.TARGET} ${.TARGET}.o
29 .if ${MKSTRIPIDENT} != "no"
30 ${OBJCOPY} -R .ident ${.TARGET}
35 ${COMPILE.S} ${ARCHDIR}/crtend.S -o ${.TARGET}.o
36 ${LD} -x -r -o ${.TARGET} ${.TARGET}.o
38 .if ${MKSTRIPIDENT} != "no"
39 ${OBJCOPY} -R .ident ${.TARGET}
48 crt0.o: crt0-common.c crt0.S
50 ${COMPILE.c} ${PICFLAGS} ${COMMON_DIR}/crt0-common.c -o ${.TARGET}.c.o
51 ${COMPILE.S} ${ARCHDIR}/crt0.S -o ${.TARGET}.S.o
52 ${LD} -x -r -o ${.TARGET} ${.TARGET}.c.o ${.TARGET}.S.o
53 rm -f ${.TARGET}.c.o ${.TARGET}.S.o
54 .if ${MKSTRIPIDENT} != "no"
55 ${OBJCOPY} -R .ident ${.TARGET}
58 gcrt0.o: crt0-common.c crt0.S
60 ${COMPILE.c} ${PICFLAGS} -DMCRT0 ${COMMON_DIR}/crt0-common.c -o ${.TARGET}.c.o
61 ${COMPILE.S} ${ARCHDIR}/crt0.S -o ${.TARGET}.S.o
62 ${LD} -x -r -o ${.TARGET} ${.TARGET}.c.o ${.TARGET}.S.o
63 rm -f ${.TARGET}.c.o ${.TARGET}.S.o
64 .if ${MKSTRIPIDENT} != "no"
65 ${OBJCOPY} -R .ident ${.TARGET}
68 sysident_assym.h: ${GENASSYM_CONF} ${GENASSYM_EXTRAS}
70 cat ${COMMON_DIR}/sysident_assym.cf | \
71 ${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
72 > sysident_assym.h.tmp && \
73 mv -f sysident_assym.h.tmp sysident_assym.h
75 CLEANFILES+= sysident_assym.h
77 crti.o: crti.S sysident_assym.h
83 SYMLINKS+= crtbegin.o ${LIBDIR}/crtbeginT.o
84 SYMLINKS+= crtend.o ${LIBDIR}/crtendS.o
85 SYMLINKS+= crt0.o ${LIBDIR}/crt1.o
87 .include <bsd.prog.mk>