CC = gcc
CFLAGS = -std=c11 -Wall -Wextra -Werror -g -O0
.PHONY: test clean
test: test-button test-button-hal
	./test-button
	./test-button-hal
test-button: test_button.c button.c button.h
	$(CC) $(CFLAGS) test_button.c button.c -o $@
demo: demo.c button.c button.h
	$(CC) $(CFLAGS) demo.c button.c -o $@
clean:	rm -f test-button test-button-hal demo

test-button-hal: test_button_hal.c button_poll.c button.c hal_sim.c button.h button_poll.h hal.h hal_sim.h
	$(CC) $(CFLAGS) test_button_hal.c button_poll.c button.c hal_sim.c -o $@
