TARGETS = ev.o wrtev.o ev-f.o

CFLAGS = $(COPTFLAGS) $(STDCFLAG) $(PICFLAG)

install:
	-rm -f $(TARGETS)
	-test -d optimised || mkdir optimised
	for FILE in $(TARGETS) ; do ln -s optimised/$$FILE ; done
	$(MAKE) "COPTFLAGS=$(OPTFLAG)" $(TARGETS)

dbx:
	-rm -f $(TARGETS)	
	-test -d debug || mkdir debug
	for FILE in $(TARGETS) ; do ln -s debug/$$FILE ; done
	$(MAKE) "COPTFLAGS=-g" $(TARGETS)

profile:
	-rm -f $(TARGETS)
	-test -d profiled || mkdir profiled
	for FILE in $(TARGETS) ; do ln -s profiled/$$FILE ; done
	$(MAKE) "COPTFLAGS=$(OPTFLAG)" $(TARGETS)

clean:
	-rm -f *.o optimised/*.o debug/*.o profiled/*.o *~ *%
	-rmdir -s optimised debug profiled

wrtev.o: wrtev.c ev.h
ev.o: ev.c ev.h
ev-f.o: ev-f.c ev.h
