# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	makedemo
#	makedemo/Makefile
#	makedemo/a.c
#	makedemo/b.c
#	makedemo/b.h
#
echo c - makedemo
mkdir -p makedemo > /dev/null 2>&1
echo x - makedemo/Makefile
sed 's/^X//' >makedemo/Makefile << 'END-of-makedemo/Makefile'
XCC=gcc
XCFLAGS=-w -O2
Xall:	a
X
Xa:	a.o b.o
X	gcc -o a a.o b.o
X
Xa.o:	a.c b.h
X
Xb.o:	b.c b.h
X
Xclean:
X	rm -f a.o b.o a
END-of-makedemo/Makefile
echo x - makedemo/a.c
sed 's/^X//' >makedemo/a.c << 'END-of-makedemo/a.c'
X#include "b.h"
X
Xint main(){
X  printf("fib(5): %d\n", fib(5,6));
X}
X
END-of-makedemo/a.c
echo x - makedemo/b.c
sed 's/^X//' >makedemo/b.c << 'END-of-makedemo/b.c'
X#include "b.h"
X
Xint fib(int n, int o){
X  if(n<2)return o;
X  return fib(n-1,o)+fib(n-2,o);
X}
END-of-makedemo/b.c
echo x - makedemo/b.h
sed 's/^X//' >makedemo/b.h << 'END-of-makedemo/b.h'
Xint fib(int n, int o);
X
END-of-makedemo/b.h
exit

