From e33942fdc634be6cf80cb92f6180f1e700b9eec5 Mon Sep 17 00:00:00 2001 From: klemek Date: Thu, 27 Aug 2026 16:57:25 +0200 Subject: [PATCH] wip --- .gitignore | 1 + Makefile | 54 +++++++++++++++++++++++++++++++++++++++++++++-------- forge-steel | 2 +- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 2abeff0..96dd449 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ error.glsl forge_default_save.txt +build diff --git a/Makefile b/Makefile index 84a9a95..97854f2 100644 --- a/Makefile +++ b/Makefile @@ -1,22 +1,60 @@ # ENV -FORGE_MAKE ?= $(MAKE) -C forge-steel -f Makefile.dev -RUN_ARGS ?= -tf --project=project -is=240 --demo +BUILD_DIR ?= build +TARGET ?= forge +RUN_ARGS ?= -tf --project=project -is=720 --demo +VERSION ?= invar-$(shell grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' forge-steel/configure.ac) # FILES -forge-steel/build/forge: - $(FORGE_MAKE) build-no-video +forge-steel/src/main.c: + $(MAKE) -s submodule-init + +forge-steel/hashmap.c/hashmap.c: + $(MAKE) -s submodule-init + +forge-steel/log.c/src/log.c: + $(MAKE) -s submodule-init + +forge-steel/include/linmath.h: + $(MAKE) -s submodule-init + +$(BUILD_DIR)/$(TARGET): forge-steel/src/main.c forge-steel/hashmap.c/hashmap.c forge-steel/log.c/src/log.c forge-steel/include/linmath.h + mkdir -p $(BUILD_DIR) + gcc \ + forge-steel/src/*.h forge-steel/src/*.c \ + -Iforge-steel/include \ + forge-steel/hashmap.c/hashmap.c \ + forge-steel/log.c/src/log.c \ + -lm -lGL -lglfw -lasound \ + -Wall -Wextra \ + -Wno-format-truncation \ + -DGLFW_INCLUDE_NONE \ + -DGLFW_NATIVE_INCLUDE_NONE \ + -DLOG_USE_COLOR \ + -DVERSION=\"$(VERSION)\" \ + -DOPENGL_MAJOR_VERSION=3 \ + -DOPENGL_MINOR_VERSION=2 \ + -o build/$(TARGET) \ + -O3 # ACTIONS +.PHONY: install-libs +install-libs: + sudo apt install libglfw3-dev libgl-dev libasound2-dev libv4l-dev + .PHONY: clean clean: - $(FORGE_MAKE) clean + rm -rf $(BUILD_DIR) .PHONY: build -build: forge-steel/build/forge +build: $(BUILD_DIR)/$(TARGET) .PHONY: run -run: - LIBGL_ALWAYS_SOFTWARE=true forge-steel/build/forge $(RUN_ARGS) +run: $(BUILD_DIR)/$(TARGET) + $(BUILD_DIR)/$(TARGET) $(RUN_ARGS) + +.PHONY: submodule-init +submodule-init: + git submodule update --init --recursive diff --git a/forge-steel b/forge-steel index 73dd4b7..a440535 160000 --- a/forge-steel +++ b/forge-steel @@ -1 +1 @@ -Subproject commit 73dd4b75d323b02f357a9cf62ae8be4f69898af2 +Subproject commit a4405359532495bb94267ff826e483c203d7704f