Add makefile.
This commit is contained in:
parent
d32d92e241
commit
7ee084385c
19
Makefile
Normal file
19
Makefile
Normal file
|
@ -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
|
Loading…
Reference in New Issue
Block a user