Initial commit

This commit is contained in:
2025-09-30 21:29:06 +10:00
commit 39735ed696
41 changed files with 1692 additions and 0 deletions

43
Makefile Normal file
View File

@@ -0,0 +1,43 @@
# Compiler
CXX = g++
# Compiler flags
# -Isrc: Add src directory to include path
# -Wall: Enable all warnings
# -Wextra: Enable extra warnings
# -std=c++17: Use C++17 standard
CXXFLAGS = -O3 -Isrc -Wall -Wextra -std=c++14
# Build directory
BUILD_DIR = build
# Find all .cpp files in src and its subdirectories
SRCS = $(shell find src -name '*.cpp')
# VPATH tells make where to look for prerequisites
VPATH = $(sort $(dir $(SRCS)))
# Object files in the build directory
OBJS = $(addprefix $(BUILD_DIR)/, $(notdir $(SRCS:.cpp=.o)))
# Name of the executable
TARGET = kyn
# The 'all' target is the default when you just run 'make'
all: $(TARGET)
# Link the object files to create the executable
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS)
# Compile .cpp files to .o files in the build directory
$(BUILD_DIR)/%.o: %.cpp
@mkdir -p $(BUILD_DIR)
$(CXX) $(CXXFLAGS) -c $< -o $@
# The 'clean' target removes generated files
clean:
rm -rf $(BUILD_DIR) $(TARGET)
# Phony targets are not files
.PHONY: all clean