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

TOPDIR = ../..

script_sub_dir = startup

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

include $(TOPDIR)/Makeconf

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

SOURCES = main-rcfile local-rcfile inputrc

DISTFILES = $(addprefix $(srcdir)/,Makefile.in $(SOURCES))

FCN_FILES =
FCN_FILES_NO_DIR =

all: PKG_ADD
.PHONY: all

install install-strip:
	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)
	if test -f $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)/octaverc; then true; \
	else \
	  $(INSTALL_DATA) $(srcdir)/main-rcfile \
	    $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)/octaverc; \
	fi
	if test -f $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)/inputrc; then true; \
	else \
	  $(INSTALL_DATA) $(srcdir)/inputrc \
	    $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)/inputrc; \
	fi
	$(top_srcdir)/mkinstalldirs $(DESTDIR)$(localfcnfiledir)/$(script_sub_dir)
	if test -f $(DESTDIR)$(localfcnfiledir)/$(script_sub_dir)/octaverc; \
	then true; \
	else \
	  $(INSTALL_DATA) $(srcdir)/local-rcfile \
	    $(DESTDIR)$(localfcnfiledir)/$(script_sub_dir)/octaverc; \
	fi
#	for f in $(FCN_FILES_NO_DIR); do \
#	  rm -f $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)/$$f; \
#	  $(INSTALL_DATA) $(srcdir)/$$f $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)/$$f; \
#	done
.PHONY: install install-strip

uninstall:
#	for f in $(FCN_FILES_NO_DIR); \
#	  do rm -f $(DESTDIR)$(fcnfiledir)/$(script_sub_dir)/$$f; \
#	done
.PHONY: uninstall

clean:
.PHONY: clean

PKG_ADD: $(FCN_FILES)
	@echo "making PKG_ADD"
	@$(do-mkpkgadd)

tags: $(SOURCES)
	ctags $(SOURCES)

TAGS: $(SOURCES)
	etags $(SOURCES)

mostlyclean: clean
.PHONY: mostlyclean

distclean: clean
	rm -f Makefile PKG_ADD
.PHONY: distclean

maintainer-clean: distclean
	rm -f tags TAGS
.PHONY: maintainer-clean

dist:
	ln $(DISTFILES) ../../`cat ../../.fname`/scripts/startup
.PHONY: dist
