Uploading files to Git

This commit is contained in:
2025-08-20 20:40:24 +02:00
parent 2ed89ad137
commit 934aea9346
345 changed files with 149802 additions and 1 deletions
+46
View File
@@ -0,0 +1,46 @@
# Compiler and flags
CC := g++
CXXFLAGS := -std=c++14 -Wall -Iinclude
# Directories
SRC_DIR := src
INC_DIR := include
OBJ_DIR := obj
BIN_DIR := bin
#
# === Executable Name ===
TARGET := $(BIN_DIR)/abc_lab
# === Find all .cpp files recursively in src/ ===
SRCS := $(shell find $(SRC_DIR) -name '*.cpp')
# === Convert src/foo/bar.cpp → obj/foo/bar.o ===
OBJS := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS))
# === Default Target ===
all: $(TARGET)
# === Linking final executable ===
$(TARGET): $(OBJS)
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -o $@ $^
# === Compiling source files to object files ===
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) -c $< -o $@
# Clean up
.PHONY: clean
clean:
rm -rf $(OBJ_DIR) $(BIN_DIR)
# Optional: print debug info
.PHONY: info
info:
@echo "Source files: $(SRCS)"
@echo "Object files: $(OBJS)"
@echo "CXXFLAGS: $(CXXFLAGS)"