# makefile for making pcl -- W. Schelter.

#  Directions:
# make -f makefile.gcl compile
# make -f makefile.gcl saved_pcl


LISP=gcl


SETUP='(load "sys-package.lisp")' \
	'(setq *features* (delete (quote kcl) *features*))'\
	'(load "defsys.lisp")(push (quote kcl) *features*)' \
	'(setq pcl::*default-pathname-extensions* (cons "lisp" "o"))' \
	'(setq pcl::*pathname-extensions* (cons "lisp" "o"))' \
	'(load "sys-proclaim.lisp")(compiler::emit-fn t)'

compile:
	echo ${SETUP} '(pcl::compile-pcl)' | ${LISP}

saved_pcl:
	echo ${SETUP} '(pcl::load-pcl)(si::save-system "saved_pcl")' | ${LISP}


# remake the sys-package.lisp and sys-proclaim.lisp files
# Those files may be empty on a first build.
remake-sys-files:
	echo ${SETUP} '(pcl::load-pcl)(in-package "PCL")(renew-sys-files)' | ${LISP}
	cp sys-proclaim.lisp xxx
	cat xxx | sed -e "s/COMPILER::CMP-ANON//g" > sys-proclaim.lisp
	rm xxx


tar:
	make -f makefile.gcl  tar1 DIR=`pwd`

tar1:
	(cd .. ; tar cvf - `basename ${DIR}` | gzip -c > `basename ${DIR}`.tgz) 
