-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
47 lines (35 loc) · 1.34 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
#Copyright Notice:
#The files within this zip file are copyrighted by Lazy Foo' Productions (2004-2014)
#and may not be redistributed without written permission.
#OBJS specifies which files to compile as part of the project
ifeq ($(shell uname), Darwin)
OBJS = lib/stds/src/*.c src/*.c
else
OBJS = lib/stds/src/*.c lib/stds/include/*.h src/*.c include/*.h
endif
#CC specifies which compiler we're using
CC = gcc
#INCLUDE_PATHS specifies the additional include paths we'll need
#LIBRARY_PATHS specifies the additional library paths we'll need
ifeq ($(OS), Windows_NT)
INCLUDE_PATHS = -IC:\MinGW\include\SDL2
endif
ifeq ($(OS), Windows_NT)
LIBRARY_PATHS = -LC:\MinGW\lib
endif
#COMPILER_FLAGS specifies the additional compilation options we're using
# -w suppresszzes all warnings
# -Wl,-subsystem,windows gets rid of the console window
COMPILER_FLAGS = -Werror -g
#LINKER_FLAGS specifies the libraries we're linking against
LINKER_FLAGS = 0
ifeq ($(OS), Windows_NT)
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf
else
LINKER_FLAGS = -lSDL2main -lSDL2 -lSDL2_image -lSDL2_mixer -lSDL2_ttf -lm
endif
#OBJ_NAME specifies the name of our exectuable
OBJ_NAME = Game
#This is the target that compiles our executable
all : $(OBJS)
$(CC) $(OBJS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS) $(LINKER_FLAGS) -o $(OBJ_NAME)