
ifeq ($(FINAL),1)
	FLAGS = -DNDEBUG -Wall -pipe -O3 -fno-strength-reduce -DCPU=586
else
	FLAGS = -g -Wall
endif

.PHONY: all clean

all: clean test work

%.o: %.cpp *.hpp
	g++ -c $(FLAGS) -o $@ $<

test: test.o
	g++ -o $@ $<

work: work.o
	g++ -o $@ $<

clean:
	rm -f test work *.o

README.pdf: README.tex
	rm -f *.aux *.log *.out
	pdflatex README.tex
	rm -f *.aux *.log *.out

