# ------------------------------------------------------------------------
# Makefile for simple examples
# ------------------------------------------------------------------------
#
# Modifications: (most recent first)
#
# RD 05/25/01	first version adjusted to SCRC


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

ALL	= Adder Behaviors BitVectors Callback DataTypes FSM \
	  HelloWorld Notes Pipeline Pipeline2 Timing \
	  Handshaking1 Handshaking2

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

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


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