-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
55 lines (44 loc) · 1.91 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
46
47
48
49
50
51
52
53
54
55
IDIR = ./include
CXX = clang++
CFLAGS = -I$(IDIR) \
-I./third_party/boost_1_83_0 \
-I./third_party/CLI11/include \
-Wno-logical-op-parentheses
ODIR = obj
LDIR = ./lib
SDIR = ./src
LIBS =
_DEPS = ast.hpp \
ast_adapted.hpp \
config.hpp \
parser.hpp \
parser_def.hpp
DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
_OBJ = main.o parser.o
OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
.PHONY: all clean
.SECONDARY: main-build
all: pre-build main-build
main-build: plurals-parser
$(ODIR)/%.o: $(SDIR)/%.cpp $(DEPS)
$(CXX) -c -o $@ $< $(CFLAGS)
plurals-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; \
mv boost_1_83_0 third_party/; \
rm boost_1_83_0.tar.bz2; \
else \
echo "INFO: No need to download boost libraries"; \
fi
@if git submodule status | egrep -q '^[-]|^[+]' ; then \
echo "INFO: Need to reinitialize git submodules"; \
git submodule update --init; \
else \
echo "INFO: No need to reinitialize git submodules"; \
fi
clean:
rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~