CC=gcc CPP=g++ BUILD=build FLAGS=-Wall -Werror -Wextra -pedantic -lantlr3c -std=c++11 NORMAL_FLAGS=$(FLAGS) -g -pg OPTIMISED_FLAGS=$(FLAGS) -O3 all: $(BUILD)/main .PHONY: check-syntax check-syntax: -$(CPP) $(FLAGS) -o /tmp/null -x c++ $(CHK_SOURCES) # the - is to ignore the return code. $(BUILD)/main: $(BUILD) EquationSystemParser.o main.cpp *.hpp $(CPP) main.cpp *.o -o $(BUILD)/main $(NORMAL_FLAGS) #fastest-main: $(BUILD) grammar # $(CPP) main.cpp *.o -o $(BUILD)/main $(OPTIMISED_FLAGS) EquationSystemParser.o: EquationSystem.g java -jar ../antlr/antlr-3.4-complete.jar EquationSystem.g $(CC) *.c -c -lantrl3c $(BUILD): mkdir -p $(BUILD) test: $(BUILD)/main bash ./test/run ./build/main clean: rm -rf $(BUILD) rm -rf *.o *.c *.h *.tokens # antlr o, c, h and tokens files