#
# Makefile  -  makefile for utilty programs
#
# Copyright (C) 1996-1998 Gero Kuhlmann   <gero@gkminix.han.de>
#
#  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 of the License, or
#  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.
#


include ../make.config
include ../make.defs


SUBDIRS	= ansidrv pktwatch


# Where to install the programs and modules
INSTDIR = $(libdir)/utils
INSTDATA = $(SUBDIRS:%=%.com)


all dep:
ifndef NO_ASM
	@for subdir in $(SUBDIRS); do \
	  echo making $@ in $$subdir; \
	  (cd $$subdir && $(MAKE) $@) || exit 1; \
	done
endif


install:	all
	$(INSTALL) -o bin -g bin -d $(INSTDIR)
	@for i in $(INSTDATA); do \
	  echo $(INSTALL) -m 644 -o bin -g bin $$i $(INSTDIR)/$$i; \
	  $(INSTALL) -m 644 -o bin -g bin $$i $(INSTDIR)/$$i; \
	done


dummy:


.PHONY:	clean realclean distclean
clean:	clean-recursive

realclean: 	realclean-recursive
	rm -f $(INSTDATA)

distclean:	distclean-recursive

clean-recursive realclean-recursive distclean-recursive:
	@for subdir in $(SUBDIRS); do \
	  target=`echo $@ | sed 's/-recursive//'`; \
	  echo making $$target in $$subdir; \
	  (cd $$subdir && $(MAKE) $$target) || exit 1; \
	done

