-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (33 loc) · 913 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
32
33
34
35
36
37
38
39
40
CXX = g++
CFLAGS = -Wall -std=c++11 $(shell sdl2-config --cflags)
LFLAGS = $(shell sdl2-config --libs) -lSDL2_image -lSDL2_ttf
PLATFORM = $(shell uname -s)
ifeq ($(RELEASE), yes)
LFLAGS += -O3
endif
ifeq ($(COMPACT), yes)
CFLAGS += -ffreestanding -fno-inline -fdata-sections -ffunction-sections \
-fno-exceptions -fno-asynchronous-unwind-tables
LFLAGS += -Os
endif
ifeq ($(DEBUG), yes)
LFLAGS += -ggdb -g3 -pg -O0
endif
ifeq ($(PLATFORM), Linux)
LFLAGS += -lGL -lGLU -lGLEW
else
LFLAGS += -lopengl32 -lglu32 -lglew32
endif
target_file := main
prog_name := golos
dest_dir := ./src/
object_files := $(patsubst %.cpp, %.o, $(wildcard $(dest_dir)*.cpp))
all: $(dest_dir)$(target_file)
$(dest_dir)$(target_file): $(object_files)
$(CXX) $(object_files) -o $(prog_name) $(LFLAGS)
strip:
strip -s $(prog_name)*
%.o: %.cpp
$(CXX) $(CFLAGS) -c $< -o $@
clean:
-$(RM) $(prog_name) $(object_files)