mirror of
https://github.com/GearsProgress/Poke_Transporter_GB.git
synced 2026-04-18 15:07:31 -05:00
Split up data-generator into payload-generator (PTGB) and table-generator (PCCS) The reason for this is because we don't want the dependencies to the payload stuff in PCCS. And the tables are embedded inside libPCCS now. Because we want to use libPCCS as a proper static lib, we now use its new Makefile to build it before we build Poke_Transporter_GB.
44 lines
1008 B
Makefile
44 lines
1008 B
Makefile
# # Compiler flags
|
|
CXXFLAGS := -std=c++20 -fno-rtti -fno-exceptions -fno-unwind-tables -Wall -Wextra -I $(CURDIR)/include -g
|
|
|
|
# Source files directory
|
|
SRC_DIR := ./src
|
|
# Build directory
|
|
BUILD_DIR := build
|
|
|
|
# Source files (add more as needed)
|
|
SRCS := $(shell find $(SRC_DIR) -type f -name '*.cpp')
|
|
# Object files
|
|
OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(BUILD_DIR)/%.o,$(SRCS))
|
|
|
|
# Ensure necessary directories exist
|
|
# This function ensures the directory for the target exists
|
|
define make_directory
|
|
@mkdir -p $(dir $@)
|
|
endef
|
|
|
|
# Target executable
|
|
TARGET := payload-generator
|
|
|
|
# Phony targets
|
|
.PHONY: all clean
|
|
|
|
# Default target
|
|
all: $(TARGET)
|
|
|
|
$(TARGET): $(OBJS)
|
|
$(CXX) $(CXXFLAGS) $^ -o $@
|
|
|
|
# Rule to compile source files
|
|
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp | $(BUILD_DIR)
|
|
$(make_directory)
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
|
|
|
# Create the build directory if it doesn't exist
|
|
$(BUILD_DIR):
|
|
mkdir -p $(BUILD_DIR)
|
|
|
|
# Clean rule
|
|
clean:
|
|
rm -rf $(BUILD_DIR) $(TARGET) *.bin
|