Archived
1
Fork 0
This repository has been archived on 2024-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
game_of_life/Makefile
2024-09-11 22:48:22 +05:00

28 lines
663 B
Makefile

# Written with extensive help from https://makefiletutorial.com
CC = g++
TARGET_EXEC = life
SRC_DIR = src
INC_DIR = include
BUILD_DIR = build
CFLAGS = -I $(INC_DIR) -MMD -MP -I c:/SDL2/include -I c:/SDL2/include/SDL2 -Dmain=SDL_main
LDFLAGS = -L c:/SDL2/lib -lmingw32 -lSDL2main -lSDL2 -mwindows -static-libstdc++ -static-libgcc
SRC = $(wildcard $(SRC_DIR)/*.cpp)
OBJ = $(SRC:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
DEP = $(OBJ:%.o=%.d)
$(TARGET_EXEC): $(OBJ)
$(CC) $(OBJ) -o $(TARGET_EXEC) $(LDFLAGS)
$(OBJ): $(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(BUILD_DIR)
$(CC) $(CFLAGS) -c $< -o $@
clean:
@rm -rf $(BUILD_DIR) $(TARGET_EXEC)
-include $(DEP)