-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (31 loc) · 850 Bytes
/
Makefile
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
CXX=clang++
SRCDIR=src
BUILDDIR=build
RESDIR=res
TARGETDIR=bin
TARGET=geno3d
SRCEXT=cpp
SOURCES = $(wildcard $(SRCDIR)/*.$(SRCEXT))
OBJECTS = $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
CXXFLAGS = -std=c++17 -Wall -pedantic
LDLIBS = -lsfml-graphics -lsfml-window -lsfml-system
# LDFLAGS = -L lib
$(TARGETDIR)/$(TARGET): $(OBJECTS)
@mkdir -p $(TARGETDIR)
@echo "Linking..."
$(CXX) $^ -o $(TARGETDIR)/$(TARGET) $(LDFLAGS) $(LDLIBS)
@echo "Copying resources..."
@cp -a $(RESDIR) $(TARGETDIR)/
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
@mkdir -p $(BUILDDIR)
$(CXX) $(CXXFLAGS) -c -o $@ $<
clean:
@echo "Cleaning..."
$(RM) -r docs $(BUILDDIR) $(TARGETDIR)
debug: CXXFLAGS += -DDEBUG -g
debug: $(TARGETDIR)/$(TARGET)
docs:
doxygen Doxyfile
fast: CXXFLAGS += -O2
fast: $(TARGETDIR)/$(TARGET)
.PHONY: clean debug docs fast