#
# This script creates a makefile for A++ to be executed
# with SMake and the SAS/C++ Development System.
#

# open the output file
echo "Creating SAS 'smakefile'.."
rm smakefile
open smakefile w 1

echo "#"^j\
"# SAS Makefile for the A++ Test programs"^j\
"# Copyright (C)1994 by Armin Vogt"^j\
"#"^j\
"# This makefile has been created automatically with 'maketst'"^j\
"# "$Id: maketst,v 1.2 1994/08/02 18:57:23 Armin_Vogt Exp Armin_Vogt $^j\
"#"^j^j\
"TESTPRGS       =    apphome:TESTPRGS/"^j\
"APPINCLUDE     =    appinclude:"^j\
"LIBFILE        =    apphome:SASC++/APPLibrary/aplusplus.lib"^j\
""^j\
""^j >.1


alias ALL        "*p%c exec set p $p; foreach s ( $p ) $c"

echo ^j".cxx.o:"^j"   sc $*.cxx includedirectory=$(APPINCLUDE) objectname=/SASC++/" >.1


echo "Making TESTPRG dependencies.."

#
# create testprg dep.: all files present in the TESTPRGS sub-directories
# are included.
#

cd apphome:testprgs
unset file
unset path
echo ^j"all: \\" >.1
ALL */*.cxx "strhead path .cxx $s;strtail file / $path;echo \" \"$file\\\\" >.1
unset file
unset path
echo ^j >.1
ALL */*.cxx "strhead path .cxx $s;strtail file / $path;echo ^j"$file: $file.o "\"$\""(LIBFILE)"^j^i"sc link "\"$*\"".o"^j^j"$file.o:  "\"$\""(TESTPRGS)$path.cxx"  >.1
dswap

# close created output file
close 1
echo "done."
