summaryrefslogtreecommitdiffstats
path: root/gnu/lib/csu/Makefile
blob: 3a94ab8d84e504b6b66a6bdd441df9a679e791fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# $FreeBSD$

GCCDIR=	${.CURDIR}/../../../contrib/gcc.295
.PATH: ${GCCDIR}

SRCS=		crtstuff.c tm.h
OBJS=		crtbegin.o crtend.o
SOBJS=		crtbegin.So crtend.So
CFLAGS+=	-I${GCCDIR}/config -I. -DIN_GCC \
		-finhibit-size-directive -fno-inline-functions \
		-fno-exceptions -fno-omit-frame-pointer
NOMAN=		true
NOPIC=		true
NOPROFILE=	true
INTERNALLIB=	true
CLEANFILES+=	tm.h

CRTS_CFLAGS=	-DCRTSTUFFS_O ${PICFLAG}

all: ${OBJS} ${SOBJS}

crtbegin.o:	crtstuff.c tm.h
	${CC} ${CFLAGS} -g0 -DCRT_BEGIN \
		-c -o ${.TARGET} ${GCCDIR}/crtstuff.c

crtbegin.So:	crtstuff.c tm.h
	${CC} ${CFLAGS} -g0 -DCRT_BEGIN ${CRTS_CFLAGS} \
		-c -o ${.TARGET} ${GCCDIR}/crtstuff.c

crtend.o:	crtstuff.c tm.h
	${CC} ${CFLAGS} -g0 -DCRT_END \
		-c -o ${.TARGET} ${GCCDIR}/crtstuff.c

crtend.So:	crtstuff.c tm.h
	${CC} ${CFLAGS} -g0 -DCRT_END ${CRTS_CFLAGS} \
		-c -o ${.TARGET} ${GCCDIR}/crtstuff.c

#	KEEP THIS IN SYNC with src/gnu/usr.bin/cc/cc_tools/Makefile !!
tm.h:
	echo '#include "${MACHINE_ARCH}/${MACHINE_ARCH}.h"'	> ${.TARGET}
.if ${MACHINE_ARCH} == "i386"
	echo '#include "${MACHINE_ARCH}/att.h"'			>> ${.TARGET}
.endif
	echo '#include <freebsd.h>'				>> ${.TARGET}
	echo '#include "${MACHINE_ARCH}/freebsd.h"'		>> ${.TARGET}
.if ${MACHINE_ARCH} == "i386"
	echo '#include "${MACHINE_ARCH}/perform.h"'		>> ${.TARGET}
.endif

realinstall:
.for file in ${OBJS} ${SOBJS}
	${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
	    ${file} ${DESTDIR}${LIBDIR}/${file:S/.So$/S.o/}
.endfor

.include <bsd.lib.mk>
OpenPOWER on IntegriCloud