-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (39 loc) · 1.04 KB
/
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# CHANGE THIS
SDL2_INCLUDE_DIR = /usr/include/SDL2
SDL2_TTF_INCLUDE_DIR =
SDL2_IMAGE_INCLUDE_DIR =
# _WINDOWS_ or _UNIX_
OS =_UNIX_
# Compiler
CC=gcc
CXX=g++
# Remove
RM=rm -f
# Move --> Windows: move, Linux: mv
MV=mv
#####
include_project = -Isource/include/ -Isource/
include_lib = -I$(SDL2_INCLUDE_DIR) -I$(SDL2_TTF_INCLUDE_DIR) -I$(SDL2_IMAGE_INCLUDE_DIR)
includes = $(include_project) $(include_lib)
#####
EXECUTABLE = strategos
CPPFLAGS= $(includes) -std=c++11 -std=gnu++11 -D$(OS)
LDFLAGS=
LDLIBS= -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer
SRCS_CPP = $(wildcard source/src/*.cpp) $(wildcard source/SDL2_gfx/*.cpp)
SRCS_C = $(wildcard source/SDL2_gfx/*.c)
SRCS = $(SRCS_CPP) $(SRCS_C)
OBJS = $(subst .cpp,.o,$(SRCS_CPP)) $(subst .c,.o,$(SRCS_C))
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJS)
g++ $(LDFLAGS) -o $(EXECUTABLE) $(OBJS) $(LDLIBS)
$(MV) $(EXECUTABLE) bin/Release/
depend: .depend
.depend: $(SRCS)
$(RM) ./.depend
$(CXX) $(CPPFLAGS) -MM $^>>./.depend;
clean:
$(RM) $(OBJS)
dist-clean: clean
$(RM) *~ .dependtool *.o
include .depend