csu: move crt files to /usr/lib
[dragonfly.git] / gnu / lib / csu / Makefile.csu
1 # $FreeBSD: src/gnu/lib/csu/Makefile,v 1.24 2004/09/10 06:48:04 ru Exp $
2 # $DragonFly: src/gnu/lib/csu/Makefile.csu,v 1.2 2007/08/23 06:52:02 corecode Exp $
3
4 SRCS+=          crtstuff.c
5 HDRS+=          tm.h
6
7 NOBJS=          crtbegin.o crtend.o
8 SOBJS=          crtbeginS.o crtendS.o
9
10 OBJS+=          ${NOBJS} ${SOBJS}
11 INSTALLOBJS+=   ${NOBJS} ${SOBJS}
12
13 OBJS+=  ${SRCS:N*.h:R:S/$/.o/g}
14
15 CFLAGS+=        -finhibit-size-directive -fno-inline-functions \
16                 -fno-exceptions -fno-zero-initialized-in-bss \
17                 -fno-omit-frame-pointer -fno-unit-at-a-time
18 CFLAGS+=        -I.
19
20 CRTS_CFLAGS=    -DCRTSTUFFS_O -DSHARED ${PICFLAG}
21 MKDEP=          -DCRT_BEGIN
22
23 BEGINSRC?=      crtstuff.c
24 ENDSRC?=        crtstuff.c
25
26 ${NOBJS} ${SOBJS}: ${HDRS}
27
28 crtbegin.o:     ${BEGINSRC}
29         ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
30                 -c -o ${.TARGET} ${.ALLSRC:N*.h}
31
32 crtbeginS.o:    ${BEGINSRC}
33         ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
34                 -c -o ${.TARGET} ${.ALLSRC:N*.h}
35
36 crtend.o:       ${ENDSRC}
37         ${CC} ${CFLAGS} -g0 -DCRT_END \
38                 -c -o ${.TARGET} ${.ALLSRC:N*.h}
39
40 crtendS.o:      ${ENDSRC}
41         ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
42                 -c -o ${.TARGET} ${.ALLSRC:N*.h}
43
44 CLEANFILES+=    tm.h options.h auto-host.h
45 beforedepend: tm.h options.h auto-host.h
46 tm.h: ${CCDIR}/cc_prep/Makefile
47         ${MAKE} -f ${.ALLSRC} MFILE=${.ALLSRC} GCCDIR=${GCCDIR} ${.TARGET}
48
49 options.h:
50         touch ${.TARGET}
51
52 auto-host.h:
53         echo '#include "dragonfly-native.h"' > ${.TARGET}
54
55 all: ${INSTALLOBJS}
56
57 realinstall:
58         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
59             ${INSTALLOBJS} ${DESTDIR}${TARGET_LIBDIR}
60
61 clean:
62         rm -f ${CLEANFILES} ${OBJS} ${OBJS:S/$/.tmp/}
63
64 .include <bsd.lib.mk>