# $Header: /home/cvs/nistnet/Makefile,v 1.2 2005/04/16 12:53:09 cvs Exp $

# This Makefile passes common flags to subdirectories.
# Mark Carson, NIST/UMCP
#	5/1998

include ./Config

ARCH = i386

.EXPORT_ALL_VARIABLES:

# This should point to the top of the Linux kernel source tree:
TOPDIR = /usr/src/linux
HPATH = $(TOPDIR)/include

# The order here is important!!
# th added tracetools
SUB_DIRS = math lib cli monitor kernel man tracetools

#include $(TOPDIR)/.config

# include $(TOPDIR)/Rules.make -- too many problems
# Just include needed rules directly:

all: sub_dirs all_targets

all_targets:

clean:	sub_clean
	-rm -f *.o $(ALL_TARGETS)

install: all sub_inst
	rm -f $(DEVHITBOX)
	mknod $(DEVHITBOX) c $(HITMAJOR) $(HITMINOR)
	rm -f $(DEVNISTNET)
	mknod $(DEVNISTNET) c $(NISTNETMAJOR) $(NISTNETMINOR)
	chown root $(DEVHITBOX)
	chown root $(DEVNISTNET)
	rm -f $(DEVMUNGEBOX)
	mknod $(DEVMUNGEBOX) c $(MUNGEMAJOR) 0
	chown root $(DEVMUNGEBOX)
	rm -f $(DEVSPYBOX)
	mknod $(DEVSPYBOX) c $(SPYMAJOR) 0
	chown root $(DEVSPYBOX)

ship: all
	# Ship target not relevant for released Makefile

#########################################################################
# Recursive subdirectory traversal stuff
.PHONY: dummy

dummy:

sub_dirs: dummy
ifdef SUB_DIRS
	set -e; for i in $(SUB_DIRS); do $(MAKE) -C $$i ; done
endif

sub_inst: dummy
ifdef SUB_DIRS
	set -e; for i in $(SUB_DIRS); do $(MAKE) -C $$i install; done
endif

sub_clean: dummy
ifdef SUB_DIRS
	set -e; for i in $(SUB_DIRS); do $(MAKE) -C $$i clean; done
endif
