#
# Makefile for octave's scripts directory
#
# John W. Eaton
# jwe@bevo.che.wisc.edu
# University of Wisconsin-Madison
# Department of Chemical Engineering

TOPDIR = ..

script_sub_dir = .

srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@

include $(TOPDIR)/Makeconf

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@

SOURCES = # *.m

DISTFILES = Makefile.in ChangeLog $(SOURCES) configure.in \
	configure mkinstalldirs

SUBDIRS = audio control elfun finance general image io linear-algebra \
	miscellaneous plot polynomial set signal specfun \
	special-matrix startup statistics strings time

DISTSUBDIRS = $(SUBDIRS)

BINDISTSUBDIRS = $(SUBDIRS)

FCN_FILES = # $(wildcard $(srcdir)/*.m)
FCN_FILES_NO_DIR = # $(notdir $(FCN_FILES))

all: $(SUBDIRS)
.PHONY: all

$(SUBDIRS):
	echo making all in $@
	cd $@ ; $(MAKE) all
.PHONY: $(SUBDIRS)

install uninstall clean mostlyclean distclean maintainer-clean::
	@$(subdir-for-command)
.PHONY: install uninstall clean mostlyclean distclean maintainer-clean

install::
	ls -LR $(datadir)/octave > $(datadir)/octave/ls-R
	ls -LR $(libexecdir)/octave > $(libexecdir)/octave/ls-R

uninstall::
	rm -f $(datadir)/octave/ls-R $(libexecdir)/octave/ls-R

tags TAGS:: $(SOURCES)
	$(SUBDIR_FOR_COMMAND)

tags::
	ctags $(SOURCES)

TAGS:: $(SOURCES)
	etags $(SOURCES)

distclean::
	rm -f Makefile config.log config.status

maintainer-clean::
	rm -f tags TAGS configure Makefile config.log config.status

dist:
	ln $(DISTFILES) ../`cat ../.fname`/scripts
	for dir in $(DISTSUBDIRS); do mkdir ../`cat ../.fname`/scripts/$$dir; cd $$dir; $(MAKE) $@; cd ..; done
.PHONY: dist

bin-dist:
	for dir in $(BINDISTSUBDIRS); do mkdir ../`cat ../.fname`/scripts/$$dir; cd $$dir; $(MAKE) $@; cd ..; done
.PHONY: bin-dist
