Merge from vendor branch LIBSTDC++:
[dragonfly.git] / gnu / lib / gcc3 / csu / Makefile
1 # $DragonFly: src/gnu/lib/gcc3/csu/Attic/Makefile,v 1.3 2004/01/21 21:59:04 joerg Exp $
2
3 GCCDIR= ${.CURDIR}/../../../../contrib/gcc3
4 CCTOOLS_SRC = ${.CURDIR}/../../../usr.bin/cc3/cc_tools
5 CCTOOLS_OBJ = ${.OBJDIR}/../../../usr.bin/cc3/cc_tools
6
7 .PATH: ${GCCDIR}
8 SRCS=           crtstuff.c
9
10 OBJS=           crtbegin.o crtend.o
11 SOBJS=          crtbegin.So crtend.So
12 CFLAGS+=        -I${GCCDIR} -I${GCCDIR}/config -I${CCTOOLS_SRC} \
13                 -I${CCTOOLS_OBJ} -DIN_GCC \
14                 -finhibit-size-directive -fno-inline-functions \
15                 -fno-exceptions -fno-omit-frame-pointer \
16                 -fno-zero-initialized-in-bss
17
18 CRTS_CFLAGS=    -DCRTSTUFFS_O ${PICFLAG}
19
20 all: ${OBJS} ${SOBJS}
21
22 CLEANFILES+=    ${OBJS} ${SOBJS}
23
24 .if exists(${CCTOOLS_OBJ})
25 TCONFIG_H = ${CCTOOLS_OBJ}/tconfig.h
26 .else
27 TCONFIG_H = ${CCTOOLS_SRC}/tconfig.h
28 .endif
29
30 crtbegin.o crtbegin.So crtend.o crtend.So: ${SRCS} ${TCONFIG_H}
31
32 crtbegin.o:
33         ${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
34                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
35
36 crtbegin.So:
37         ${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
38                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
39
40 crtend.o:
41         ${CC} ${CFLAGS} -g0 -DCRT_END \
42                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
43
44 crtend.So:
45         ${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
46                 -c -o ${.TARGET} ${UGLYHACK} ${.ALLSRC:N*.h}
47
48 ${TCONFIG_H}: ${CCTOOLS_SRC}/Makefile
49         cd ${CCTOOLS_SRC} && make tconfig.h
50
51 beforedepend: ${TCONFIG_H}
52
53 realinstall:
54 .for file in ${OBJS} ${SOBJS}
55         ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
56             ${file} ${DESTDIR}${GCCLIBDIR}/${file:S/.So$/S.o/}
57 .endfor
58
59 .include <bsd.lib.mk>