CC=gcc
CFLAGS=-Wall

all: clean bin/part01 bin/part02
	@echo "built all"

run1: clean bin/part01
	cat data/p01data.txt | bin/part01

run2: clean bin/part02
	cat data/p02data.txt | bin/part02

test1: clean bin/part01
	cat data/p01test.txt | bin/part01
	@echo "8 is correct answer"

test2: clean bin/part02
	cat data/p02test.txt | bin/part02
	@echo "2286 is correct answer"

bin/part01:
	$(CC) src/part01.c -o bin/part01 

bin/part02:
	$(CC) src/part02.c -o bin/part02

.PHONY: clean,pytest1,pytest2,pyrun1,pyrun2

clean:
	rm -f bin/*

pytest1:
	cat data/p01test.txt | python3 src/part01.py

pyrun1:
	cat data/p01data.txt | python3 src/part01.py

pytest2:
	cat data/p02test.txt | python3 src/part02.py

pyrun2:
	cat data/p02data.txt | python3 src/part02.py