#
# Makefile for octave's scripts directory
#
# John W. Eaton
# jwe@che.utexas.edu
# Department of Chemical Engineering
# The University of Texas at Austin

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 $(SOURCES)

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

DISTSUBDIRS = $(SUBDIRS)

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

all:
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
.PHONY: all

install:
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
.PHONY: install

uninstall:
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
.PHONY: uninstall

clean:
.PHONY: clean

tags: $(SOURCES)
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
	ctags $(SOURCES)

TAGS: $(SOURCES)
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
	etags $(SOURCES)

mostlyclean: clean
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
.PHONY: mostlyclean

distclean: clean
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
	rm -f Makefile
.PHONY: distclean

realclean:
	for dir in $(SUBDIRS); do echo making $@ in $$dir; cd $$dir; $(MAKE) $@; cd ..; done
	rm -f tags TAGS Makefile
.PHONY: realclean

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

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