-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (49 loc) · 1.92 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
57
58
59
60
61
62
63
64
SHELL =/bin/sh
CXX =g++
SDL2CFLAGS = $(shell sdl2-config --cflags --libs)
CXXFLAGS =-Wall -Wuninitialized -std=c++17 -g $(SDL2CFLAGS) -mfpu=neon
CXXFLAGS_DIST =-Wall -Wuninitialized -std=c++17 $(SDL2CFLAGS) -mfpu=neon
INCLUDE = -Iinclude/
SRC = $(wildcard ./src/*.cpp)
OBJECTS = $(subst ./src/,$(OBJ_DIR)/, $(SRC:.cpp=.o))
EXE = micro
#INCLUDE_PATHS specifies the additional include paths we'll need
INCLUDE_PATHS = -ID:\programmation\tools\c\mingw\SDL2\i686-w64-mingw32\include
#LIBRARY_PATHS specifies the additional library paths we'll need
LIBRARY_PATHS = -LD:\programmation\tools\c\mingw\SDL2\i686-w64-mingw32\lib -LD:\programmation\tools\c\mingw\SDL2_MIXER\i686-w64-mingw32\lib
#COMPILER_FLAGS specifies the additional compilation options we're using
# -w suppresses all warnings
# -Wl,-subsystem,windows gets rid of the console window
COMPILER_FLAGS = -Wall -Wuninitialized -std=c++17
#LINKER_FLAGS specifies the libraries we're linking against
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2
all: compile
dist:
@echo "File sources : $(SRC)"
@echo "Target : $@"
$(CXX) $(CXXFLAGS_DIST) $(INCLUDE) -o $(EXE) $(SRC) -O3
compile:
@echo "File sources : $(SRC)"
@echo "Target : $@"
$(CXX) $(CXXFLAGS) $(INCLUDE) -o $(EXE) $(SRC)
all_windows: clean_windows
@echo "File sources : $(SRC)"
@echo "Target : $@"
$(CXX) $(SRC) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS) -g $(LINKER_FLAGS) -o $(EXE).exe
clean_windows:
rm -f $(EXE).exe
windows_dist_all: windows_dist_compile
mv $(EXE).exe dist
windows_dist_compile: windows_dist_prepare
@echo "File sources : $(SRC)"
@echo "Target : $@"
$(CXX) $(SRC) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(EXE).exe
windows_dist_prepare:
@echo "File sources : $(SRC)"
@echo "Target : $@"
rm -rf dist
mkdir dist
cp windows/dll/* dist
.PHONY: all mkdirs clean
clean:
rm $(EXE).exe