3154f6338e98105e38e0378544cdf9dee894537f
[dragonfly.git] / gnu / lib / gcc3 / csu / Makefile
1 # $DragonFly: src/gnu/lib/gcc3/csu/Attic/Makefile,v 1.4 2004/02/02 23:35:09 dillon Exp $
2
3 .include "../Makefile.inc"
4
5 .PATH: ${GCCDIR}/gcc
6 SRCS=           crtstuff.c
7
8 OBJS=           crtbegin.o crtend.o
9 SOBJS=          crtbegin.So crtend.So
10
11 CFLAGS+=        -I${GCCDIR}/gcc -I${GCCDIR}/gcc/config \
12                 -I${GCCDIR}/include -I${CCTOOLS_SRC} -I${DFLYH} \
13                 -I${GCCIR}/gcc/config \
14                 -I${CCTOOLS_OBJ}
15
16 CFLAGS+=        -DIN_GCC \
17                 -finhibit-size-directive -fno-inline-functions \
18                 -fno-exceptions -fno-omit-frame-pointer \
19                 -fno-zero-initialized-in-bss
20
21 CRTS_CFLAGS=    -DCRTSTUFFS_O ${PICFLAG}
22
23 # crtbegin.c needs either CRT_BEGIN or CRT_END defined, and we can't
24 # set a default in CFLAGS because we need to switch down below.
25 #
26 MKDEPCMD=       CC="${CC}" MKDEP_CPP_OPTS="-M -DCRT_BEGIN" mkdep
27
28 all: ${OBJS} ${SOBJS}
29
30 CLEANFILES+=    ${OBJS} ${SOBJS}
31
32 .if exists(${CCTOOLS_OBJ})
33 TCONFIG_H = ${CCTOOLS_OBJ}/tconfig.h
34 .else
35 TCONFIG_H = ${CCTOOLS_SRC}/tconfig.h
36 .endif
37
38 crtbegin.o crtbegin.So crtend.o crtend.So: ${SRCS} ${TCONFIG_H}
39
40 crtbegin.o:
41         ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
42                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
43
44 crtbegin.So:
45         ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
46                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
47
48 crtend.o:
49         ${CC} ${CFLAGS} -g0 -DCRT_END \
50                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
51
52 crtend.So:
53         ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
54                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
55
56 ${TCONFIG_H}: ${CCTOOLS_SRC}/Makefile
57         cd ${CCTOOLS_SRC} && make tconfig.h
58
59 beforedepend: ${TCONFIG_H}
60
61 realinstall:
62 .for file in ${OBJS} ${SOBJS}
63         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
64             ${file} ${DESTDIR}${GCCLIBDIR}/${file:S/.So$/S.o/}
65 .endfor
66
67 .include <bsd.lib.mk>