include Makefile.config

SUBDIRS=compiler support lib frx jtk safe jpf tkanim


Makefile.config:
	@echo "You must configure first. Read INSTALL."
	exit 1

all:	Makefile.config
	cd support; $(MAKE)
	cd compiler; $(MAKE)
	cd lib; $(MAKE) -f Makefile.gen; $(MAKE)
	cd frx; $(MAKE)
	cd jtk; $(MAKE)
#	cd threads; $(MAKE)
	cd jpf; $(MAKE)
	cd tkanim; $(MAKE)
	cd safe; $(MAKE)

opt:	Makefile.config
	cd support; $(MAKE) opt
	cd lib; $(MAKE) -f Makefile.gen; $(MAKE) opt
	cd frx; $(MAKE) opt
	cd jtk; $(MAKE) opt
	cd jpf; $(MAKE) opt
	cd tkanim; $(MAKE) opt

lib: Widgets.src
	compiler/tkcompiler
	cd lib; $(MAKE)

install: 
	test -d $(INSTALLDIR) || mkdir $(INSTALLDIR)
	cp Makefile.camltk $(INSTALLDIR)
	cd lib; $(MAKE) install
	cd support; $(MAKE) install
	cd compiler; $(MAKE) install
	cd frx; $(MAKE) install
	cd jpf; $(MAKE) install
	cd jtk; $(MAKE) install
	cd tkanim; $(MAKE) install
	cd safe; $(MAKE) install

installopt: 
	test -d $(INSTALLDIR) || mkdir $(INSTALLDIR)
	cd lib; $(MAKE) installopt
	cd frx; $(MAKE) installopt
	cd jpf; $(MAKE) installopt
	cd jtk; $(MAKE) installopt
	cd tkanim; $(MAKE) installopt

clean : 
	-rm -f config.cache
	for d in $(SUBDIRS); do \
	cd $$d; $(MAKE) clean; cd ..; \
	done

distclean:  clean
	-rm -f config.log config.status config.cache
	-rm -f Makefile.config Makefile.camltk
