-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
25 lines (17 loc) · 729 Bytes
/
Makefile
File metadata and controls
25 lines (17 loc) · 729 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
SRC_DIR := src
BUILD_DIR := build
TARGET := bin/sdl.exe
SRC_EXT := cpp
SOURCES := $(shell find $(SRC_DIR) -type f -name *.$(SRC_EXT))
OBJECTS := $(patsubst $(SRC_DIR)/%,$(BUILD_DIR)/%,$(SOURCES:.$(SRC_EXT)=.o))
INCLUDE_PATHS = -ID:/MinGW/external_lib/include/SDL2 -I include
LIBRARY_PATHS = -LD:/MinGW/external_lib/lib -lmingw32 -lSDL2main -lSDL2_ttf -lSDL2_image -lSDL2_mixer -lSDL2 -L lib
COMPILER_FLAGS = -g -Wall -Wno-write-strings -std=gnu++0x
CC = g++
$(TARGET): $(OBJECTS)
$(CC) $^ -o $(TARGET) $(LIBRARY_PATHS)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.$(SRC_EXT)
@mkdir -p $(BUILD_DIR)
$(CC) $(COMPILER_FLAGS) $(LIBRARY_PATHS) $(INCLUDE_PATHS) -c -o $@ $<
clean:
$(RM) -r $(BUILD_DIR) $(TARGET)