-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
39 lines (31 loc) · 1.93 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
CC = gcc
#vec2d.c primitives.c
OBJS = basics.c main.c
ifeq ($(OS),Windows_NT) # Windows_NT is the identifier for all versions of Windows
DETECTED_OS := Windows
else
DETECTED_OS := $(shell uname)
endif
ifeq ($(DETECTED_OS),Windows)
INCLUDE_PATHS = -IC:/SDL/SDL2-2.28.2/i686-w64-mingw32/include/SDL2
INCLUDE_PATHS += -IC:/SDL/SDL2_image-2.6.3/i686-w64-mingw32/include/SDL2
LIBRARY_PATHS = -LC:/SDL/SDL2-2.28.2/i686-w64-mingw32/lib
LIBRARY_PATHS += -LC:/SDL/SDL2_image-2.6.3/i686-w64-mingw32/lib
LINKER_FLAGS = -lmingw32 -lSDL2main -lSDL2 -lSDL2_image
else
INCLUDE_PATHS = -I/usr/include/SDL2
LINKER_FLAGS = -lm -lSDL2 -lSDL2_image
endif
COMPILER_FLAGS_RELEASE = -w -Wl,-subsystem,windows
COMPILER_FLAGS_QUICK = -w
COMPILER_FLAGS_DEBUG = -fmax-errors=3 -Waddress -Warray-bounds=1 -Wbool-compare -Wformat -Wimplicit -Wlogical-not-parentheses -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args -Wmissing-braces -Wmultistatement-macros -Wopenmp-simd -Wparentheses -Wpointer-sign -Wrestrict -Wreturn-type -Wsequence-point -Wsizeof-pointer-div -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstrict-overflow=1 -Wtautological-compare -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wvolatile-register-var -Wcast-function-type -Wmissing-field-initializers -Wmissing-parameter-type -Woverride-init -Wsign-compare -Wtype-limits -Wshift-negative-value
COMPILER_FLAGS_MAX = -Wall -Wextra -Werror -O2 -std=c99 -pedantic
OBJ_NAME = ImageViewer
release : $(OBJS)
$(CC) $(OBJS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS_RELEASE) $(LINKER_FLAGS) -std=c11 -o $(OBJ_NAME)
quick : $(OBJS)
$(CC) $(OBJS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS_QUICK) $(LINKER_FLAGS) -std=c11 -o $(OBJ_NAME)
debug : $(OBJS)
$(CC) $(OBJS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS_DEBUG) $(LINKER_FLAGS) -std=c11 -o $(OBJ_NAME)
max : $(OBJS)
$(CC) $(OBJS) $(INCLUDE_PATHS) $(LIBRARY_PATHS) $(COMPILER_FLAGS_MAX) $(LINKER_FLAGS) -std=c11 -o $(OBJ_NAME)