#!/bin/sh
set -e
WDIR="$1"

# pips include makefiles from newgen and linear ...
cat linear-svn/libraries.make newgen-svn/libraries.make $WDIR/libraries.make | sed -e '/^include/ d' -e 's/polylib/polylib64/' > pips.tmp
mv -f pips.tmp $WDIR/libraries.make
cat newgen-svn/src/genC/standard_defines.mk $WDIR/src/Documentation/doxygen/Makefile | sed -e '/^include $(NEWGEN/ d' >pips.tmp
mv -f pips.tmp $WDIR/src/Documentation/doxygen/Makefile
rm -f pips.tmp

# get rid of the hard-coded ARCH thing
sed -i -e 's,$(ARCH)/$(LIB_TARGET),$(LIB_TARGET),' \
	-e 's,lib/$(ARCH)/lib,lib/lib,g' \
	$WDIR/makes/pips-bin.mk

sed -i -e 's,/$(ARCH),,g' \
	$WDIR/makes/flags.mk

# default config, nicer for new users
cp config.mk $WDIR/makes/
