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