# $Header: /home/cvs/nistnet/cli/Makefile,v 1.3 2005/04/14 11:27:17 cvs Exp $

# This Makefile compiles the command-line programs
# Mark Carson, NIST/UMCP
#	5/1998

ARCH = i386

.EXPORT_ALL_VARIABLES:

include ../Config

CFLAGS += $(USERCFLAGS) -I.. -I../include

# th - added flowseed
ALL_TARGETS= hitbox cnistnet mungebox nistspy flowseed
LIBNISTNET= ../lib/libnistnet.a

all: all_targets

all_targets: $(ALL_TARGETS)

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

# th added flowseed
install: all
	-mkdir /usr/local/bin
	install -o root hitbox cnistnet /usr/local/bin
	install -o root mungebox /usr/local/bin
	install -o root nistspy /usr/local/bin
	install -o root flowseed /usr/local/bin

ship: all
	# Ship target not relevant for released Makefile

hitbox: hitbox.c ../include/nistnet.h $(LIBNISTNET)
	$(CC) $(CFLAGS) -o hitbox hitbox.c $(LIBNISTNET) -lm

cnistnet: cnistnet.c ../include/nistnet.h $(LIBNISTNET)
	$(CC) $(CFLAGS) -o cnistnet cnistnet.c $(LIBNISTNET) -lm

mungebox: mungebox.c ../include/nistnet.h
	$(CC) $(CFLAGS) -o mungebox mungebox.c -lm

nistspy: nistspy.c ../include/nistnet.h ../include/nistspy.h
	$(CC) $(CFLAGS) -o nistspy nistspy.c
	
# th added two lines
flowseed: flowseed.c ../include/flow.h
	$(CC) $(CFLAGS) -o flowseed flowseed.c

#########################################################################
# 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
