CPPFLAGS := -std=c++11 `llvm-config-7.0-64 --cppflags --ldflags --libs --system-libs all` CC := g++ TARGET := lily # $(wildcard *.cpp /xxx/xxx/*.cpp): get all .cpp files from the current directory and dir "/xxx/xxx/" SRCS := $(wildcard src/*.cpp) # # $(patsubst %.cpp,%.o,$(SRCS)): substitute all ".cpp" file name strings to ".o" file name strings OBJS := $(patsubst src/%.cpp,%.o,$(SRCS)) all: $(TARGET) $(TARGET): $(OBJS) parser-c.o $(CC) $(CPPFLAGS) -o $@ $^ %.o: src/%.cpp $(CC) $(CPPFLAGS) -c $< clean: rm -rf $(TARGET) *.o parser-c.o: gcc -c -o parser-c.o src/parser.c .PHONY: all clean