-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
40 lines (29 loc) · 726 Bytes
/
makefile
File metadata and controls
40 lines (29 loc) · 726 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
39
40
# Define the compiler
CXX = clang++
# Define the source files
SOURCES = ./game.cpp ./AudioPlayer.cpp
# Define the object files
OBJECTS = $(SOURCES:.cpp=.o)
# Define the flags
CXXFLAGS = -O3
# SDL flags
#`pkg-config --libs --cflags sdl3`
SDL_FLAGS = `pkg-config --cflags sdl3`
SDL_LIBS = `pkg-config --libs sdl3`
# Combine all flags and libraries
FLAGS = $(CXXFLAGS) $(SDL_FLAGS)
LIBS = $(SDL_LIBS)
# Define the target executable
TARGET = Change
# Default rule
all: $(TARGET)
# Rule to build the target
$(TARGET): $(OBJECTS)
$(CXX) $(OBJECTS) $(LIBS) -o $(TARGET)
# Pattern rule for building object files
%.o: %.cpp
$(CXX) $(FLAGS) -c $< -o $@
# Clean rule
clean:
rm -f $(TARGET) $(OBJECTS)
.PHONY: all clean run