ifeq ($(shell ver),)
# Linux/CygWin
CC = gcchdt
CP = cp -f
RM = rm -f
else
# DOS/Windows
CC = gcchdt
CP = copy
RM = del
endif

SOURCES = $(wildcard *.c)
TARGETS = $(SOURCES:%.c=%.hex)

DESTINATION = ../../hex/eye3

all: $(TARGETS)

clean:
	$(RM) *.o
	$(RM) *.hex
	$(RM) *~

%.hex: %.c
	$(CC) -o $@ $^
	$(CP) $@ $(DESTINATION)
