From 7ee084385cc06052cbc646b02adea2fbcdedc15b Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Wed, 12 Jun 2019 20:35:50 -0700 Subject: [PATCH] Add makefile. --- Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Makefile 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