LIBS = $(shell llvm-config --libs) LIBS += -lclang-cpp CXXFLAGS = -Wall CXXFLAGS += -Wextra CXXFLAGS += -Werror CXXFLAGS += -O3 SAN ?= 1 ifeq ($(SAN),1) FLAGS = -fsanitize=address -fsanitize=leak -fsanitize=undefined endif run: gen-ir ./$^ gen-ir: gen-ir.o $(CXX) -o $@ $^ $(LIBS) $(FLAGS) %.o: %.cc $(CXX) -o $@ -c $^ $(CXXFLAGS) $(FLAGS) fmt: clang-format -i *.cc clean: $(RM) gen-ir *.o