###
### Makefile for GNU Interactive Tools
### $Id: Makefile.in,v 1.8 1998/03/12 18:24:43 tudor Exp $
###

###
### Copyright (C) 1993-1998 Free Software Foundation, Inc.
###
### This program is  free software; you can  redistribute it and/or modify
### it under the terms  of the GNU General Public  License as published by
### the  Free Software Foundation; either version  2,  or (at your option)
### any later version.
###
### This program is distributed  in the hope that  it will be  useful, but
### WITHOUT    ANY  WARRANTY;  without   even   the  implied  warranty  of
### MERCHANTABILITY  or  FITNESS FOR  A PARTICULAR   PURPOSE.  See the GNU
### General Public License for more details.
###
### You should  have received a  copy of  the GNU  General Public  License
### along with   this  program; if   not,  write  to   the Free   Software
### Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
###


PRODUCT		= "@PRODUCT@"
VERSION		= "@VERSION@"

HOST		= @HOST@
MAKE		= @MAKE@

srcdir		= @srcdir@
VPATH		= @srcdir@

prefix		= @prefix@
exec_prefix	= @exec_prefix@
bindir		= $(exec_prefix)/bin
libdir		= $(prefix)/lib/git
infodir		= $(prefix)/info
htmldir		= $(prefix)/lib/git/html
mandir		= $(prefix)/man/man1
termdir		= $(prefix)/lib/git/term

SHELL		= /bin/sh
CHMOD		= chmod
TAR		= tar
GZIP		= gzip
BASENAME	= basename
SUBDIRS		= src info man term html


all:
	@(\
	    echo "Making $(PRODUCT) $(VERSION)...";\
	    echo "Configured for $(HOST)";\
	)
	$(MAKE) prefix-change
	(cd src && $(MAKE) $@)

prefix-change:

install-dirs:
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done

info: FORCE-info
	@(\
	    echo "Making $(PRODUCT) $(VERSION) info documentation...";\
	    echo "Configured for $(HOST)";\
	)
	(cd info && $(MAKE) $@)

FORCE-info:

html: FORCE-html
	@(\
	    echo "Making $(PRODUCT) $(VERSION) html documentation...";\
	    echo "Configured for $(HOST)";\
	)
	(cd html && $(MAKE) $@)

FORCE-html:

dvi:
	(cd info && $(MAKE) $@)

ps:
	(cd info && $(MAKE) $@)

install: all install-only

install-only:
	@(\
	    echo "Installing $(PRODUCT) $(VERSION)...";\
	    echo "Configured for $(HOST)";\
	)
	$(MAKE) install-dirs &&\
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done
	@echo "Please see the README file for additional information"

install-strip:
	@(\
	    echo "Installing $(PRODUCT) $(VERSION)...";\
	    echo "Configured for $(HOST)";\
	)
	$(MAKE) install-dirs &&\
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done
	@echo "Please see the README file for additional information"

strip:
	(cd $(srcdir)/src && $(MAKE) $@)

dep:
	(cd $(srcdir)/src && $(MAKE) $@)

distdone:
	@echo "Making distribution tarball for $(PRODUCT) $(VERSION)"
	cvs commit
	cd $(srcdir) && cd ..;\
	mkdir $$HOME/tmp 2> /dev/null;\
	name=git-`echo $(VERSION)|sed 's/ /-/g'`;\
	$(CHMOD) -R a+rX,g-w,o-w git;\
	cp -r git $$HOME/tmp/$$name;\
	$(CHMOD) -R a+rX,g-w,o-w $$HOME/tmp/$$name;\
	cd $$HOME/tmp;\
	$(TAR) -X$$HOME/src/git/exclude -cf - $$name|\
	$(GZIP) -9c > $$name.tar.gz;\
	\
	if test $$? != 0; then\
	    rm -rf $$name;\
	    rm $$name.tar.gz;\
	    exit 1;\
	fi;\
	rm -rf $$name;\
	mv $$name.tar.gz $$HOME/src

dist: dep tags info html distclean distdone

uninstall:
	@echo "Uninstalling $(PRODUCT) $(VERSION)..."
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done
	@echo "Please remove the GIT entry from the Info dir file."

tags:
	cd $(srcdir)/src && $(MAKE) $@

etags:
	cd $(srcdir)/src && $(MAKE) $@

clean:
	-rm -f *.o *~ core* tutu* gogu* .gdb_history prefix.new
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done

mostlyclean: clean

distclean: clean
	-rm -f Makefile config.status config.log config.cache config.h
	-rm -f version.h prefix prefix.new
	\
	for dir in $(SUBDIRS);\
	do\
	    (cd $$dir && $(MAKE) $@);\
	done

realclean: distclean

# Tell version [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
