-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (28 loc) · 797 Bytes
/
Makefile
File metadata and controls
38 lines (28 loc) · 797 Bytes
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
CXX := g++
CXXFLAGS := -O2 -std=c++20 -static -fno-plt
INCLUDES := -Iinclude
LDLIBS := -lpanelw -lmenuw -lformw -lncursesw -ltinfo
SRC_DIR := src
BUILD_DIR := build
BIN_DIR := bin
TARGET := $(BIN_DIR)/sentinel
SRCS := \
$(wildcard $(SRC_DIR)/*.cpp) \
$(wildcard $(SRC_DIR)/app/*.cpp) \
$(wildcard $(SRC_DIR)/core/*.cpp) \
$(wildcard $(SRC_DIR)/flow/*.cpp) \
$(wildcard $(SRC_DIR)/ui/*.cpp) \
$(wildcard $(SRC_DIR)/algorithms/*.cpp)
OBJS := $(SRCS:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
all: $(TARGET)
$(TARGET): $(OBJS)
@mkdir -p $(BIN_DIR)
$(CXX) $(CXXFLAGS) $(OBJS) \
-Wl,--start-group $(LDLIBS) -Wl,--end-group \
-o $@
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
clean:
rm -rf $(BUILD_DIR) $(BIN_DIR)
.PHONY: all clean