-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (23 loc) · 865 Bytes
/
Makefile
File metadata and controls
33 lines (23 loc) · 865 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
# Makefile for BaghChal (macOS)
# Requires SFML 2 installed via Homebrew (brew install sfml@2)
CXX = clang++
CXXFLAGS = -std=c++17 -I/opt/homebrew/opt/sfml@2/include -Wall -Wextra -Wno-c++11-narrowing
LDFLAGS = -L/opt/homebrew/opt/sfml@2/lib -lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio
SRC_DIR = baghchal
OBJ_DIR = obj
SRCS = $(filter-out $(SRC_DIR)/Tuner.cpp, $(wildcard $(SRC_DIR)/*.cpp))
OBJS = $(patsubst $(SRC_DIR)/%.cpp, $(OBJ_DIR)/%.o, $(SRCS))
TARGET = baghchal_game
all: $(TARGET)
$(TARGET): $(OBJS)
$(CXX) $(OBJS) -o $(TARGET) $(LDFLAGS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp | $(OBJ_DIR)
$(CXX) $(CXXFLAGS) -c $< -o $@
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
clean:
rm -rf $(OBJ_DIR) $(TARGET)
# Standalone tools (no SFML dependency)
tuner: $(SRC_DIR)/Tuner.cpp
$(CXX) -std=c++17 -O2 -DTUNER_STANDALONE $< -o tuner
.PHONY: all clean tuner