##################################################
# Makefile
# iperf source tree
#
# by Mark Gates <mgates@nlanr.net>
# October 1999
# $Id: Makefile,v 1.2 2000/02/07 18:30:41 mgates Exp $

SHELL = /bin/sh

TOP = ..

include $(TOP)/Makefile.rules

##################################################
# files to clean

CLEAN_FILES      = *.class *~ core

DIST_CLEAN_FILES = $(CLEAN_FILES)

##################################################
# files

SRCS = BindLayout.java   \
       Interface.java    \
       Iperf.java

OBJS = BindLayout.class   \
       Interface.class    \
       Iperf.class

JAR_FILE = $(TOP)/jperf.jar

JAR_OBJS = *.class

PROG     = $(TOP)/jperf

##################################################
# targets
#
# all       -- compile the iperf program
# clean     -- remove object files
# depend    -- reate dependency files
# distclean -- remove object files
# install   -- compile and install the jperf program
#              call from top level 'make install'
#

all: $(JAR_FILE)

clean:
	-rm -f $(CLEAN_FILES)

depend:
	$(CC) -MM $(INCS) $(CFLAGS) *.cpp > Makefile.depends

distclean:
	-rm -f $(DIST_CLEAN_FILES)

install: $(JAR_FILE)
	$(INSTALL) -d $(INSTALL_DIR)
	$(INSTALL) $(PROG) $(INSTALL_DIR)
	$(INSTALL) -m 0644 $(JAR_FILE) $(INSTALL_DIR)

.PHONY: all clean depend distclean install

##################################################
# build specific files

$(JAR_FILE): $(SRCS)
	make $(OBJS)
	$(JAR) -cvf $(JAR_FILE) $(JAR_OBJS)
