-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (30 loc) · 684 Bytes
/
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
CXXFLAGS ?= -std=c++20 -pedantic -Wall -Wextra -O2
CPPFLAGS += \
-I src/ \
-I src/grammar \
-I src/parsing
TARGET = spark
SRC = \
src/spark.cpp \
src/grammar/style.cpp \
src/grammar/segment.cpp \
src/grammar/color.cpp
OBJ = $(patsubst src/%.cpp,.obj/%.o,$(SRC))
DEPEND = $(OBJ:.o=.d)
all: $(TARGET)
$(TARGET): $(OBJ)
$(CXX) $(LDFLAGS) -o $@ $^
.obj/:
mkdir -p .obj/
mkdir -p .obj/grammar
mkdir -p .obj/parsing
.obj/%.o: src/%.cpp .obj/
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
.obj/%.o: CXXFLAGS += -MMD -MP
-include $(DEPEND)
clean:
$(RM) $(OBJ) $(DEPEND)
$(RM) -r .obj/
distclean: clean
$(RM) $(TARGET)
.PHONY: all clean distclean prepare