summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cc/c++filt/Makefile
blob: 5e801de45adbc23e6584a3d37505725d6b29c783 (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
#
# $Id$
#

PROG =	c++filt
SRCS =	cplus-dem.c getopt.c getopt1.c
OBJS+=  underscore.o		# defeat 'make depend'
BINDIR=	/usr/bin
NOMAN=	1
CFLAGS+= -DMAIN -DIN_GCC -DVERSION=\"$(version)\"


#
# XXX This is a hack, but it seems to work.  libgcc1.a is supposed to be
# compiled by the native compiler, and libgcc2.a is meant to be compiled
# by *this* version of gcc.
#
# Normally, this does not make any difference, since we only have gcc, but
# when bootstrapping from gcc-2.6.3, we have to use the freshly built 2.7.2
# compiler for some of the libgcc2.c __attribute__ stuff.
#
.if exists(${.OBJDIR}/../cc)
XCC=	${.OBJDIR}/../cc/cc
.else
XCC=	${.CURDIR}/../cc/cc
.endif

.if exists(${.OBJDIR}/../cc1)
XCC+=	-B${.OBJDIR}/../cc1/
.else
XCC+=	-B${.CURDIR}/../cc1/
.endif

.if exists(${.OBJDIR}/../cpp)
XCC+=	-B${.OBJDIR}/../cpp/
.else
XCC+=	-B${.CURDIR}/../cpp/
.endif

CLEANFILES+= underscore.c
underscore.o: underscore.c

underscore.c:
	echo "int xxy_us_dummy;" >tmp-dum.c
	${XCC} -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
	rm -f tmp-dum.c tmp-dum.s

.include <bsd.prog.mk>

OpenPOWER on IntegriCloud