#
# $Id: Makefile,v 1.5 1999/04/04 16:36:31 obrien Exp $
#

.include "../Makefile.inc"

.PATH: ${GCCDIR}

PROG =	c++filt
SRCS =	cplus-dem.c getopt.c getopt1.c underscore.c
NOMAN=	1
CFLAGS+= -DMAIN -DIN_GCC -DVERSION=\"$(version)\"

CLEANFILES= tmp-dum.c tmp-dum.s underscore.c

underscore.c:
	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
	rm -f tmp-dum.c tmp-dum.s

.include <bsd.prog.mk>

#
# $Id: Makefile,v 1.6 1999/07/04 15:51:39 bde Exp $
#

.include "../Makefile.inc"

.PATH: ${GCCDIR}

PROG =	c++filt
SRCS =	cplus-dem.c getopt.c getopt1.c underscore.c
BINDIR=	/usr/libexec/${OBJFORMAT}
NOMAN=	1
CFLAGS+= -DMAIN -DIN_GCC -DVERSION=\"$(version)\"

CLEANFILES= tmp-dum.c tmp-dum.s underscore.c

underscore.c:
	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
	rm -f tmp-dum.c tmp-dum.s

.include <bsd.prog.mk>

Install c++filt in /usr/libexec/${OBJFORMAT}. The version that was installed in /usr/bin normally got clobbered when objformat was installed. Indirection through objformat is correct although underscore handling is the only thing that differs for aout and elf -- going through objformat is the easiest way to set c++filt's underscore handling flag correctly.
Install c++filt in /usr/libexec/${OBJFORMAT}.  The version that
was installed in /usr/bin normally got clobbered when objformat
was installed.  Indirection through objformat is correct although
underscore handling is the only thing that differs for aout and
elf -- going through objformat is the easiest way to set c++filt's
underscore handling flag correctly.
