CFLAGS = -I/usr/local/include/libftdi1
LDFLAGS = -lftdi1
TARGETS = prog switch upload term


%.o: %.c
	$(CC) $(CFLAGS) -c $<

all: $(TARGETS)

prog: prog.o
	$(CC) -o $@ $< $(LDFLAGS)

switch: switch.o
	$(CC) -o $@ $< $(LDFLAGS)

term: term.o tty.o
	$(CC) -o $@ $^ $(LDFLAGS)

upload: upload.o tty.o
	$(CC) -o $@ $^ $(LDFLAGS)

clean:
	rm -f *.o
	rm -f $(TARGETS)