HC = ghc
HC_MAKE = $(HC) -Wall --make $< -o $@ -main-is $(notdir $@) $(HC_OPTIONS)
EXAMPLES=PropagateEvents AlarmEventPropagation

all:$(EXAMPLES)

%: %.hs
	$(HC_MAKE)

PropagateEvents:PropagateEvents.hs IntEntry.hs AllEventsComposite.hs
AlarmEventPropagation:AlarmEventPropagation.hs

.PHONY: clean remake

remake:
# It is wrong to specify these as targets, as they must be run in specified order.
# Though, you will only see this problem with parallel make (-j).
	$(MAKE) clean
	$(MAKE) all

clean:
	- rm *.hi *.o *~ $(EXAMPLES)

