diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bb55418 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +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