Compare commits

2 Commits

Author SHA1 Message Date
Jan Mrna
9b08c057e0 New Makefile 2025-09-27 15:09:04 +02:00
Jan Mrna
ec57ce7418 Moved test.cpp 2025-09-27 15:08:21 +02:00
3 changed files with 33 additions and 8 deletions

2
.gitignore vendored
View File

@@ -1,4 +1,4 @@
tags
python/.ipynb_checkpoints
cpp/test
cpp/build
cpp/pathfinding

View File

@@ -1,9 +1,34 @@
all: test pathfinding
# TODO add extra warnings
# TODO linter?
# ---------------------------------
# Generated by Kimi K2
#---------- configurable ----------
CXX := g++
CXXFLAGS := -std=c++23 -Wall -Wextra -Wpedantic -ggdb3
LDFLAGS :=
LDLIBS := -lSDL3 -lSDL3_image -lGLEW -lGL
pathfinding:
g++ -Wall -ggdb3 -lSDL3 -lSDL3_image -std=c++23 -lGLEW -lGL -o pathfinding src/main.cpp src/sprite.cpp src/entities.cpp src/gameloop.cpp src/map.cpp src/pathfindingdemo.cpp src/tile.cpp src/user_input.cpp src/window.cpp
SRC_DIR := src
BUILD_DIR:= build
TARGET := pathfinding
test: src/test.cpp src/array.hpp
g++ -Wall -Wextra -Wpedantic -ggdb3 -std=c++23 -lgtest -o test src/test.cpp
#----------------------------------
SOURCES := $(wildcard $(SRC_DIR)/*.cpp)
OBJECTS := $(SOURCES:$(SRC_DIR)/%.cpp=$(BUILD_DIR)/%.o)
#----------------------------------
.PHONY: all clean
all: $(TARGET)
# link step
$(TARGET): $(OBJECTS)
$(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
# compile step
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cpp | $(BUILD_DIR)
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(BUILD_DIR):
mkdir -p $@
clean:
rm -rf $(BUILD_DIR) $(TARGET)