some coverity fixes.
[minix.git] / lib / csu / common / Makefile.inc
blobb7809924d75b0dcf7dd67b7e7e38168aa5a7e145
1 #       $NetBSD: Makefile.inc,v 1.2 2010/12/07 19:51:02 joerg Exp $
3 .include <bsd.own.mk>
5 COMMON_DIR:=    ${.PARSEDIR}
6 .PATH:          ${COMMON_DIR}
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
13 realall: ${OBJS}
15 crtbegin.o: crtbegin.S
16         ${_MKTARGET_COMPILE}
17         ${COMPILE.S} ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
18         ${LD} -x -r -o ${.TARGET} ${.TARGET}.o
19         rm -f ${.TARGET}.o
20 .if ${MKSTRIPIDENT} != "no"
21         ${OBJCOPY} -R .ident ${.TARGET}
22 .endif
24 crtbeginS.o: crtbegin.S
25         ${_MKTARGET_COMPILE}
26         ${COMPILE.S} -DSHARED ${ARCHDIR}/crtbegin.S -o ${.TARGET}.o
27         ${LD} -x -r -o ${.TARGET} ${.TARGET}.o
28         rm -f ${.TARGET}.o
29 .if ${MKSTRIPIDENT} != "no"
30         ${OBJCOPY} -R .ident ${.TARGET}
31 .endif
33 crtend.o: crtend.S
34         ${_MKTARGET_COMPILE}
35         ${COMPILE.S} ${ARCHDIR}/crtend.S -o ${.TARGET}.o
36         ${LD} -x -r -o ${.TARGET} ${.TARGET}.o
37         rm -f ${.TARGET}.o
38 .if ${MKSTRIPIDENT} != "no"
39         ${OBJCOPY} -R .ident ${.TARGET}
40 .endif
42 .if ${MKPIC} != "no"
43 PICFLAGS=       -fPIC
44 .else
45 PICFLAGS=
46 .endif
48 crt0.o: crt0-common.c crt0.S
49         ${_MKTARGET_COMPILE}
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}
56 .endif
58 gcrt0.o: crt0-common.c crt0.S
59         ${_MKTARGET_COMPILE}
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}
66 .endif
68 sysident_assym.h: ${GENASSYM_CONF} ${GENASSYM_EXTRAS}
69         ${_MKTARGET_CREATE}
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
78 crtn.o: crtn.S
80 FILES=${OBJS}
81 FILESDIR=${LIBDIR}
82 CLEANFILES+=${OBJS}
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>