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