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

29 lines
576 B
Makefile
Raw Permalink Normal View History

2024-09-11 17:48:22 +00:00
# Written with extensive help from https://makefiletutorial.com
CC = g++
TARGET_EXEC = life
SRC_DIR = src
INC_DIR = include
BUILD_DIR = build
2024-09-11 17:57:22 +00:00
CFLAGS = -I $(INC_DIR) -MMD -MP $(shell sdl2-config --cflags)
LDFLAGS = $(shell sdl2-config --libs)
2024-09-11 17:48:22 +00:00
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)