# The SPIMS software is covered by a license. The use of the software
# represents acceptance of the terms and conditions in the license.
# ******************************************************************
# Copyright (c) 1989, Swedish Institute of Computer Science
############################################################
# Makefile for Protocol Benchmarks
############################################################
#
# Available in this SPIMS distribution are support for the following protocols:
#
# ARPA = tcp udp vmtp ftp ftpascii
# SUN = sunrpc tcprpc
# OTHERS = null
# ISODE = ftam ftamascii tsap isoros
# SUNLINK = sunlink-tp4 suntp4
#
# Add from above set to variables below (or delete). Default:
 
ARPA = tcp udp ftp ftpascii
SUN = sunrpc tcprpc
OTHERS = null
ISODE = 
SUNLINK = 

EXPERIMENTAL = ssap mms

PROTOCOLS = ${ARPA} ${SUN} ${OTHERS} ${ISODE} ${SUNLINK}

all:
	@echo Recompiling OBJ
	@(cd OBJ; $(MAKE))
	-@for i in $(PROTOCOLS); do ( \
		if [ ! -d $$i ]; then \
			mkdir $$i; \
		fi; \
		if [ ! -f $$i/Makefile ]; then \
			cp config/Makefile.protogen $$i/Makefile; \
			chmod ug+w $$i/Makefile; \
			echo >$$i/makefile.conf; \
			( cd $$i; $(LN) ../config/make make; ) ; \
			echo Edit the Makefile for the $$i protocol; \
			echo Add a port number to protocols/protoport.c; \
		else ( \
			echo ; \
			echo $$i protocol ... ; \
			cd $$i; \
			$(MAKE) config;	\
			$(MAKE)	\
		) fi ) \
	done;

clean:
	@for i in OBJ $(PROTOCOLS); do \
		echo $$i protocol ... ; \
		(cd $$i; $(MAKE) clean); done;


.DEFAULT:
	@for i in $(PROTOCOLS); do \
		echo $$i protocol ... ; \
		(cd $$i; $(MAKE) $@); done;


index:
	ctags -txw tcp/protospec.h tcp/addrspec.h h/*.h src/*.c >index
	index.fixup <index | index.outify >index.out

shark: 
	shark RCS OBJ/RCS config autoconf h src dist composers \
		initiators responders protocols protoaddrs \
		doc bin benchmarks filters infile runs \
		> shark















