summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cc/collect2/Makefile
blob: c7283d6f63d2f5680414bbe52672488bc3f4e740 (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
# $FreeBSD$

.include "../Makefile.inc"

.PATH: ${GCCDIR}

PROG=	collect2
SRCS=	collect2.c cplus-dem.c tlink.c underscore.c
BINDIR=	/usr/libexec
NOMAN=
NOSHARED=yes

DPADD+=	${LIBCC_INT}
LDADD+=	${LIBCC_INT}

CLEANFILES= tmp-dum.c tmp-dum.s underscore.c
underscore.c: Makefile
	echo "int xxy_us_dummy;" >tmp-dum.c
	${CC} -S tmp-dum.c
	echo '/*WARNING: This file is automatically generated!*/' >underscore.c
	if grep _xxy_us_dummy tmp-dum.s > /dev/null ; then \
	  echo "int prepends_underscore = 1;" >>underscore.c; \
	else \
	  echo "int prepends_underscore = 0;" >>underscore.c; \
	fi
	# wrong to do this here, but easiest way out to duplicate gcc.c.
	echo "char *xstrerror(int e) { return strerror(e); }" >>underscore.c
	rm -f tmp-dum.c tmp-dum.s

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