Compare commits
2 Commits
c55e76a4ba
...
9b08c057e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b08c057e0 | ||
|
|
ec57ce7418 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
tags
|
||||
python/.ipynb_checkpoints
|
||||
cpp/test
|
||||
cpp/build
|
||||
cpp/pathfinding
|
||||
|
||||
39
cpp/Makefile
39
cpp/Makefile
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user