# ------------------------------------------------------------------------
# Makefile for testbench examples
# ------------------------------------------------------------------------
#
# Modifications: (most recent first)
#
# 05/25/01 RD	renamed 'scc' to 'scrc'; eliminated '.sir' suffix
# 05/15/01 RD	added waitfor6
# 05/12/01 RD	added par4, pipe8, pipe9, try29, waitfor4, waitfor5
# 05/11/01 RD	added try24, try25, try26, try27, try28
# 05/10/01 RD	added try22, try23
# 05/09/01 RD	added try20, try21
# 05/08/01 RD	added try13, try14, try15, try16, try17, try18, try19
# 05/07/01 RD	added notifyone6, notifyone7, try0, try1, try2, try3, try4,
#		try5, try6, try7, try8, try9, try10, try11, try12
# 04/06/01 RD	added wait2, wait3, wait4
# 04/04/01 RD	added pipe0, pipe1, pipe2, pipe3, pipe4, pipe5, pipe6,
#		pipe7, piped0, piped1, piped2
# 04/03/01 RD	added par3, wait1, notifyone0, notifyone1, notifyone2,
#		notifyone3, notifyone4 notifyone5
# 04/02/01 RD	added wait0, notify0, notify1, notify2, notify3, notify4
# 03/30/01 RD	added waitfor0, waitfor1, waitfor2, waitfor3
# 03/28/01 RD	first version


# --- macros -------------------------------------------------------------

ALL	= par0 par1 par2 par3 par4					\
	  waitfor0 waitfor1 waitfor2 waitfor3 waitfor4 waitfor5		\
		waitfor6						\
	  wait0	wait1 wait2 wait3 wait4					\
	  notify0 notify1 notify2 notify3 notify4			\
	  notifyone0 notifyone1 notifyone2 notifyone3 notifyone4	\
		notifyone5 notifyone6 notifyone7			\
	  pipe0 pipe1 pipe2 pipe3 pipe4 pipe5 pipe6 pipe7 pipe8 pipe9	\
	  piped0 piped1 piped2						\
	  try0 try1 try2 try3 try4 try5 try6 try7 try8 try9		\
		try10 try11 try12 try13 try14 try15 try16 try17 try18	\
		try19 try20 try21 try22 try23 try24 try25 try26 try27	\
		try28 try29

SCC	= scrc
SCCOPT	= -vv -w -g
RM	= rm -f


# --- SpecC rules --------------------------------------------------------

.SUFFIXES:
.SUFFIXES:	.sc .cc .o

.sc.cc:
	$(SCC) $* -sc2cch $(SCCOPT)

.cc.o:
	$(SCC) $* -cc2o $(SCCOPT)

.o:
	$(SCC) $* -o2out $(SCCOPT)

.cc:
	$(SCC) $* -cc2out $(SCCOPT)

.sc:
	$(SCC) $* -sc2out $(SCCOPT)


# --- targets ------------------------------------------------------------

all:	$(ALL)

clean:
	-$(RM) *.bak *.BAK
	-$(RM) *.si *.cc *.h *.o
	-$(RM) $(ALL) *.exe
	-$(RM) core

test:	$(ALL)
	set -e;					\
	for file in $(ALL); do ./$$file ; done


# --- EOF ----------------------------------------------------------------
