blob: 929dc66257ad1ee28085dacad2964717807e6b51 (
plain)
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
|
include setup.mk
CC = gcc
CXX = g++
ifeq ($(TARGET_OS),linux)
LIBS = -lpthread -lGL -lGLEW -lfreetype \
-lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2main
endif
ifeq ($(TARGET_OS),win32)
LIBS = -lopengl32 -lglew32 -lmingw32 \
-lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lfreetype
endif
CXXFLAGS = -g -m$(TARGET_BITS) -std=c++14
CXXINC = -Iinclude -Iinclude/freetype
CXXWARN = -Wall -Wextra -Werror #-pedantic-errors
CXXSRCDIR = src
CXXOUTDIR = out
CXXSRC = $(wildcard $(CXXSRCDIR)/*.cpp)
CXXOBJ = $(patsubst $(CXXSRCDIR)/%.cpp, $(CXXOUTDIR)/%.o, $(CXXSRC))
EXEC = main
all: $(EXEC)
dirty:
rm -rf out/world.o
clean:
rm -f $(EXEC)
rm -f out/*.o
cleandata:
rm -rf xml/*.dat
rm -rf storyXML/*.dat
$(EXEC): $(CXXOUTDIR)/$(CXXOBJ) main.cpp
@echo " CXX/LD main"
@$(CXX) $(CXXFLAGS) $(CXXINC) $(CXXWARN) -o $(EXEC) main.cpp out/*.o $(LIBS)
@rm -rf xml/*.dat
@rm -rf storyXML/*.dat
$(CXXOUTDIR)/%.o: $(CXXSRCDIR)/%.cpp
@echo " CXX " $<
@$(CXX) $(CXXFLAGS) $(CXXINC) $(CXXWARN) $(LIBS) -c $< -o $@
|