#
#       Makefile for $(DENNOUDIR)/util/gtool-3.1/src
#       

include	../Mkinclude

LIBDIRS		= gftool ggtool ghtool gmtool gptool gttool gutool
BINDIRS		= sample
SUBDIRS		= $(LIBDIRS) $(BINDIRS)

all:	libs

libs:
	for i in $(LIBDIRS) ; do \
	  cd $$i ; \
	  sleep 10 ; \
	  echo "Making $$i/" ; \
	  $(MAKE) ; \
	  cd .. ; \
	done

bins:
	for i in $(BINDIRS) ; do \
	  cd $$i ; \
	  echo "Making $$i/" ; \
	  $(MAKE) ; \
	  cd .. ; \
	done

install: install-lib install-bin

install-lib: $(LIBRARY)
	-if (test $(LIBDIR) != $(LIBDEST)) then \
	$(INSTALL) $(LIBRARY) $(LIBDEST); \
	$(RANLIB) $(LIBDEST)/$(LIB) ; fi

install-bin: bins
	for i in $(BINDIRS) ; do \
	  cd $$i ; \
	  echo "Installing $$i/" ; \
	  $(MAKE) install; \
	  cd .. ; \
	done


clean: clean.local clean.dir

clean.all: clean.local clean.dir

clean.local:
	$(RM) *~

clean.dir:
	@for i in $(SUBDIRS) ; do \
	  cd $$i ; \
	  echo "Cleaning $$i/" ; \
	  $(MAKE) clean ; \
	  cd .. ; \
	done

tags:
	@$(TAGS) */*.F
	@for i in $(LIBDIRS) ; do \
	  cd $$i ; \
	  $(MAKE) tags ; \
	  cd .. ; \
	done

index:
	@for i in $(LIBDIRS) ; do \
	  cd $$i ; \
	  $(MAKE) index ; \
	  cd .. ; \
	done

print:
	@for i in $(LIBDIRS) ; do \
	  cd $$i ; \
	  echo "Printing $$i/" ; \
	  $(MAKE) print ; \
	  cd .. ; \
	done

$(PACK):
	@for i in $(LIBDIRS) ; do \
	  cd $$i ; \
	  echo "Packing $$i/" ; \
	  $(MAKE) pack; \
	  cd .. ; \
	done	


