-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (51 loc) · 1.18 KB
/
Copy pathMakefile
File metadata and controls
57 lines (51 loc) · 1.18 KB
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
48
49
50
51
52
53
54
55
56
57
SRC = src/main.cpp\
src/GameDef.cpp\
src/Assets.cpp\
src/assets/Sounds.cpp\
src/assets/Textures.cpp\
src/systems/enemy.cpp\
src/systems/hacks.cpp\
src/systems/store.cpp\
src/systems/waves.cpp\
src/systems/player.cpp\
src/systems/bullets.cpp\
src/systems/message.cpp\
src/systems/waves.cpp\
src/systems/music.cpp\
src/draw/fog.cpp\
src/draw/face.cpp\
src/draw/game.cpp\
src/draw/gameOver.cpp\
src/draw/menu.cpp\
src/draw/pausedOverlay.cpp\
src/draw/player.cpp\
src/draw/store.cpp\
src/draw/statusbar.cpp\
src/math/physics.cpp
DEPENDS := $(wildcard *.hpp)
BUILDDIR = build
EXE = build/pou
CXX = g++
GCC = gcc
CXXFLAGS = -Wall -Wextra $(shell pkg-config --cflags sfml-all)
CFLAGS =
CPPFLAGS = --std=c++23 -O3 -march=native
LFLAGS = -L/opt/homebrew/lib $(shell pkg-config --libs sfml-all)
OBJS = $(SRC:%=$(BUILDDIR)/%.o)
all: $(EXE)
run: $(EXE)
$(EXE)
rebuild: clean $(EXE)
rebuild-run: clean $(EXE)
$(EXE)
clean:
rm -rf $(BUILDDIR)
.PHONY: all run clean
$(BUILDDIR)/%.cpp.o: %.cpp $(DEPENDS)
mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@
$(BUILDDIR)/%.c.o: %.c
mkdir -p $(dir $@)
$(GCC) $(CXXFLAGS) $(CFLAGS) -c $< -o $@
$(EXE): $(OBJS)
$(CXX) -o $@ $^ $(LFLAGS)