
.PRECIOUS: %.cpp
%.cpp: %.l
	flex -o $@ $<

%.o: %.cpp
	g++ -g -o $@ -c $<

test.elf: lexer.o test.o
	g++ -o $@ $^

.PHONY: run
run: test.elf
	./test.elf example.txt

.PHONY: clean
clean:
	rm -f lexer.cpp *.o *.elf
