forked from christianhaitian/351Files
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (22 loc) · 683 Bytes
/
Copy pathMakefile
File metadata and controls
28 lines (22 loc) · 683 Bytes
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
TARGET = 351Files
START_PATH ?= "/"
RES_PATH ?= "./res"
ifeq ($(DEVICE),PC)
CC = $(CXX)
SDL2_CONFIG = sdl2-config
START_PATH = $(PWD)
DEVICE_FLAG = -DDEVICE_PC
else ifneq ($(DEVICE),)
DEVICE_FLAG = -DDEVICE_$(DEVICE)
endif
SRC = $(wildcard src/*.cpp)
OBJ = $(patsubst %cpp,%o,$(SRC))
COMPILER_FLAGS = $(shell $(SDL2_CONFIG) --cflags) -Wall -pedantic -Wfatal-errors $(DEVICE_FLAG) -DSTART_PATH=\"$(START_PATH)\" -DRES_PATH=\"$(RES_PATH)\"
LINKER_FLAGS = $(shell $(SDL2_CONFIG) --libs) -lSDL2_image -lSDL2_ttf
all : $(OBJ)
$(CC) $(OBJ) -o $(TARGET) $(LINKER_FLAGS)
%.o:%.cpp
$(CC) -c $< -o $@ $(COMPILER_FLAGS)
clean :
rm -f $(OBJ) $(TARGET)
rm -f $(OBJ) $(TARGET)-sd2