# Makefile for elk	-*-Makefile-*-
# Copyright (C) 1996 Henry S. Thompson ht@thales.cogsci.ed.ac.uk
# $Header: /home/ht/work/dsssl/dsc-1.0/elk-3.0/RCS/Makefile.sub.in,v 1.3 1997/01/27 14:45:02 ht Exp $

# Name of GNU make utility, maybe
@SET_MAKE@

# Keep /bin/sh cd from screwing up
CDPATH =

srcdir=@srcdir@

all_elk-3.0:	srcs-installed config/system config/site include scripts src/module.o scm lib/unix lib/misc


src/module.o:
	cd src; $(MAKE) Makefile.local ;\
	        $(MAKE) -f Makefile.local module.o

include: FORCE
	cd include; $(MAKE) Makefile.local; \
	            $(MAKE) -f Makefile.local

scripts: FORCE
	cd scripts; $(MAKE) Makefile.local; \
		    $(MAKE) -f Makefile.local ; \
	            cp ldflags ../src 

scm: FORCE
	test -d runtime || ln -s . runtime
	cd scm; $(MAKE) Makefile.local ;\
	        $(MAKE) -f Makefile.local

lib/unix: FORCE
	cd lib/unix; $(MAKE) Makefile.local ;\
	        $(MAKE) -f Makefile.local install

lib/misc: FORCE
	cd lib/misc; $(MAKE) Makefile.local ;\
	        $(MAKE) -f Makefile.local install

srcs-installed:
	gunzip -c $(srcdir)/elk-3.0-bits.tar.gz | tar -xf -

config/system:
	cd config; ln -s @ELKSYS@ system

config/site:
	( echo "install_dir=$(INSTALLDIR)" ; cat config/site-stub ) > config/site
clean_elk-3.0:	config/system config/site
	@for i in src scm ;\
	do \
	    echo Cleaning $$i...; \
	    ( cd $$i ;\
              if test ! -f Makefile.local; then $(MAKE) Makefile.local; fi; \
             $(MAKE) -f Makefile.local clean ) || exit $$?; \
	done

FORCE:
