#############################################################
# Top Level NEC Makefile                                    #
# (C) 1999 Alan Bain <alanb@chiark.greenend.org.uk>         #
# Under GPL licence                                         #
#############################################################

RM= rm -f
# Things to pass to all makes
MAKEDEFS =
INSTALL = /usr/bin/install -o root -g root -c
INSTALL_PROGRAM = $(INSTALL) 
DESTDIR = 
BINDIR = $(DESTDIR)/usr/local/bin


SUBDIRS= somnec nec
#default target
all: Makefile all-recursive

all-recursive:
	for subdir in $(SUBDIRS); do \
	  (cd $$subdir && $(MAKE) $(MAKEDEFS) all) || exit 1; \
        done

install:
	$(INSTALL_PROGRAM) nec/nec2 $(BINDIR) 
	$(INSTALL_PROGRAM) somnec/somnec $(BINDIR)

clean:	clean-recursive clean-local

clean-local:
	$(RM) *~

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