-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (34 loc) · 1.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
IDIR = ./include
CXX = clang++
CFLAGS = -I$(IDIR) \
-I./third_party/boost_1_83_0 \
-Wno-logical-op-parentheses
ODIR = obj
LDIR = ./lib
SDIR = ./src
LIBS =
_DEPS =
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
_OBJ = expression-parser.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
.PHONY: all clean
.SECONDARY: main-build
all: pre-build main-build
main-build: expression-parser
$(ODIR)/%.o: $(SDIR)/%.cpp $(DEPS)
$(CXX) -c -o $@ $< $(CFLAGS)
expression-parser: $(OBJ)
$(CXX) -o $@ $^ $(CFLAGS) $(LIBS)
pre-build:
@if [ ! -d "./third_party/boost_1_83_0" ] ; then \
echo "INFO: Downloading boost libraries"; \
wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.bz2; \
tar --bzip2 -xf boost_1_83_0.tar.bz2; \
mkdir -p third_party obj; \
mv boost_1_83_0 third_party/; \
rm boost_1_83_0.tar.bz2; \
else \
echo "INFO: No need to download boost libraries"; \
fi
clean:
rm -rf $(ODIR) expression-parser