OS	= @OS@
ARCH	= @ARCH@
ROOT	= @ROOT@
EXEEXT	= @EXEEXT@
TKFLAGS	= @TKFLAGS@
XPAFLAGS= @XPAFLAGS@
TKIMGFLAGS = @TKIMGFLAGS@
TKTABLEFLAGS = @TKTABLEFLAGS@
JOBS	= 4

include ./make.include

#--------------------------build

.PHONY	: saods9 tcl tk

saods9	: dirs tcl tk \
	tclcheckdns tcliis tclsignal \
	tclzvfs tclxml xmlrpc xpa \
	tkblt tktable tkimg \
	tkmpeg tkhtml tkcon \
	tksao ds9

tcl	: $(TCLDIR)/unix/Makefile
	@echo ""
	@echo "*** Install $(TCLDIR) ***"
	$(MAKE) -C $(TCLDIR)/unix -j $(JOBS) install

$(TCLDIR)/unix/Makefile :
	@echo ""
	@echo "*** Configure $(TCLDIR) ***"
	cd $(TCLDIR)/unix; \
	./configure \
	--prefix $(ROOT) -exec-prefix $(ROOT) \
	--disable-shared --enable-symbols \
	--config-cache --cache-file=../../config.cache

tk	: $(TKDIR)/unix/Makefile
	@echo ""
	@echo "*** Install $(TKDIR) ***"
	$(MAKE) -C $(TKDIR)/unix -j $(JOBS) install

$(TKDIR)/unix/Makefile :
	@echo ""
	@echo "*** Configure $(TKDIR) ***"
	cd $(TKDIR)/unix; \
	./configure \
	$(TKFLAGS) \
	--prefix $(ROOT) -exec-prefix $(ROOT) \
	--disable-shared --enable-symbols \
	--config-cache --cache-file=../../config.cache

#--------------------------clean

.PHONY	: tkunixclean

tkunixclean :

#--------------------------distclean

.PHONY	: tkunixdistclean

tkunixdistclean :

#--------------------------distribution

.PHONY	: dist

dist	:
	cd bin; tar cvf - ds9* | gzip > ../dist/ds9.$(ARCH).$(DS9VERSION).tar.gz
	cd bin; tar cvf - xpa* | gzip > ../dist/xpa.$(ARCH).$(XPAVERSION).tar.gz

