#
# Makefile.am - automake configuration file for nana.
#

AUTOMAKE_OPTIONS = gnu serial-tests

MAINT_CHARSET = latin1

SUBDIRS = src test examples doc man gdb emacs perf shortform

EXTRA_DIST = TODO REGISTRATION aclocal.m4 ANNOUNCE INSTALL.con \
		showconfig.c PROJECTS

AWK = @AWK@
CPP = @CPP@
TAR = @TAR@
DEFS = @DEFS@

#
# The PROJECTS file is autogenerated from the info documentation
#  (This should only happen on the development machine or after
#   you start playing with changes to the documentation)
#

PROJECTS: 	doc/nana.info
	info -o PROJECTS --file=nana.info --directory=./doc -n Future

#
# Configure: a variety of #define's are generated by ./configure and
# user options for things such as the action on failure. This target
# is used by configure script (or the user) to get a summary of the
# final results.
#

showconfig:
	$(CPP) $(CPPFLAGS) -I$(top_srcdir)/src $(DEFS) $(top_srcdir)/showconfig.c | grep "==>" 

#
# various targets for the maintainer to build patches, releases, etc.
#

#dist-hook:	release_tags patches

dist-hook:	
		echo nothing to do now

PREV_VERSION = @PREV_VERSION@

DIFF_FILE= nana-$(PREV_VERSION)-$(VERSION).diff

PREV_VERSION_TAG = `echo nana-$(PREV_VERSION) | sed -e 's/\\./-/g'`
VERSION_TAG = `echo nana-$(VERSION) | sed -e 's/\\./-/g'`


patches:
	echo "Patches for nana $(PREV_VERSION) to $(VERSION)">$(DIFF_FILE) 
	-cvs rdiff -r $(PREV_VERSION_TAG) -r $(VERSION_TAG) . >>$(DIFF_FILE)
	gzip -f -9 $(DIFF_FILE)

old-patches:
	echo "Patches for nana $(PREV_VERSION) to $(VERSION)">$(DIFF_FILE)
	rm -rf nana-$(PREV_VERSION) nana-$(VERSION)
	gzcat nana-$(PREV_VERSION).tar.gz | tar xf -
	gzcat nana-$(VERSION).tar.gz | tar xf -
	-(cd nana-$(PREV_VERSION) ; diff -r -c -d \
		--exclude "*.ps" --exclude "*.info*" \
		. ../nana-$(VERSION)) >>$(DIFF_FILE)
	gzip -f -9 $(DIFF_FILE)
 
release_tags:	
	cvs commit -m "Release nana $(VERSION)" .
	cvs rtag -F "$(VERSION_TAG)" nana 

check:
	echo everything is ok









