all: ccompiler

run: ccompiler
	./ccompiler test.c flat.bin

ccompiler: frontend ir
	gcc -g rv32ima_codegen.c -L../../frontend -lfrontend -L../../middleend -lir -o ccompiler

frontend:
	make -C ../../frontend

ir:
	make -C ../../middleend

clean:
	rm -f ccompiler flat.bin
	make -C ../../frontend clean
	make -C ../../middleend clean