-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (22 loc) · 671 Bytes
/
Makefile
File metadata and controls
31 lines (22 loc) · 671 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
SRC_DIR := src
OBJ_DIR := obj
BIN_DIR := .
EXE := $(BIN_DIR)/discord-ytmusic-rpc
SRC := $(wildcard $(SRC_DIR)/*.cpp)
OBJS := $(SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
CXX = g++
CPPFLAGS := $(shell python3-config --cflags) -Iinclude -MMD -MP
CXXFLAGS := -std=c++17 -Wall -fPIE
LDLIBS := -lpthread -ldiscord-rpc
LDFLAGS := -Llib $(shell python3-config --ldflags --embed)
.PHONY: all clean
all: $(EXE)
$(EXE): $(OBJS) | $(BIN_DIR)
$(CXX) $^ $(LDFLAGS) $(LDLIBS) -o $@
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(OBJ_DIR)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $< -o $@
$(BIN_DIR) $(OBJ_DIR):
mkdir -p $@
clean:
@$(RM) -rvf $(OBJS) $(EXE) $(OBJ_DIR)
-include $(OBJ:.o=.d)