-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
31 lines (28 loc) · 859 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
# set compiler
CC = g++
# include files
INCLUDE = -I ./include
#compilers flags for compiling object files
CFLAGSO = -std=c++14 -Wall -m64 -O3 -c ${INCLUDE}
# libraries
LIBS = -lSDL2main -lSDL2 -lSDL2_image -lSDL2_ttf -lSDL2_mixer
#compilers flags for compiling binary file
CFLAGSB = -s ${LIBS}
default: objCompile
mkdir -p ./make/bin
${CC} ./make/build/*.o -o ./make/bin/main ${CFLAGSB}
cp -r ./res ./make/bin/res
objCompile:
mkdir -p ./make/build
${CC} ./src/*.cpp ${CFLAGSO}
# laymans way to move object files to make/build folder
mv *.o ./make/build
windows: winObjCompile
mkdir -p ./make/bin
${CC} ./make/build/*.o -o ./make/bin/main ${CFLAGSB} -mwindows
cp -r ./res ./make/bin/res
winObjCompile:
mkdir -p ./make/build
${CC} ./src/*.cpp ${CFLAGSO} -mwindows
# laymans way to move object files to make/build folder
mv *.o ./make/build