From 2a4d25b1fc60d0ad7baa72a524cae8c446e433a5 Mon Sep 17 00:00:00 2001 From: klemek Date: Fri, 28 Aug 2026 11:53:59 +0200 Subject: [PATCH] wip --- Makefile | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 79f9c23..f66b975 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,10 @@ # ENV -BUILD_DIR ?= $(PWD)/build -FORGE_SRC ?= $(PWD)/forge-steel +PROJECT_DIR ?= $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) +BUILD_DIR ?= $(PROJECT_DIR)/build +FORGE_SRC ?= $(PROJECT_DIR)/forge-steel TARGET ?= forge -RUN_ARGS ?= --project=$(PWD)/project -is=576 +RUN_ARGS ?= --project=$(PROJECT_DIR)/project -is=576 VERSION ?= invar-$(shell grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' $(FORGE_SRC)/configure.ac) SOURCES ?= $(FORGE_SRC)/src/*.h $(FORGE_SRC)/src/*.c $(FORGE_SRC)/hashmap.c/hashmap.c $(FORGE_SRC)/log.c/src/log.c CFLAGS ?= -Ofast -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays -fno-exceptions -fopenmp -I$(FORGE_SRC)/include -DGLFW_INCLUDE_NONE -DGLFW_NATIVE_INCLUDE_NONE -DLOG_USE_COLOR -DVERSION=\"$(VERSION)\" -DOPENGL_MAJOR_VERSION=3 -DOPENGL_MINOR_VERSION=1 @@ -11,6 +12,9 @@ LDLIBS ?= -lm -lGL -lglfw -lasound # FILES +test: + echo $(PROJECT_DIR) + forge-steel/src/main.c: $(MAKE) -s submodule-init @@ -39,24 +43,24 @@ apt-install: .PHONY: setup-weston setup-weston: - ln -fs $(PWD)/system/weston.ini $(HOME)/.config/weston.ini + ln -fs $(PROJECT_DIR)/system/weston.ini $(HOME)/.config/weston.ini .PHONY: setup-rasp-config setup-rasp-config: if [ -z $(shell grep "include forge-invar.txt" "/boot/firmware/config.txt") ]; then sudo sh -c 'echo "include forge-invar.txt" >> /boot/firmware/config.txt'; fi - sudo cp -f $(PWD)/system/config.ini /boot/firmware/forge-invar.txt + sudo cp -f $(PROJECT_DIR)/system/config.ini /boot/firmware/forge-invar.txt if [ -z $(shell grep "vc4.tv_norm" "/boot/firmware/cmdline.txt") ]; then sudo sh -c 'echo "vc4.tv_norm=PAL" >> /boot/firmware/cmdline.txt'; fi .PHONY: setup-services setup-services: - sudo ln -fs $(PWD)/system/getty@tty1.service /etc/systemd/system/getty@tty1.service + sudo ln -fs $(PROJECT_DIR)/system/getty@tty1.service /etc/systemd/system/getty@tty1.service sudo systemctl daemon-reload sudo systemctl enable getty@tty1.service seatd.service .PHONY: setup-user-services setup-user-services: - sudo ln -fs $(PWD)/system/weston.service /etc/systemd/user/weston.service - sudo ln -fs $(PWD)/system/weston.socket /etc/systemd/user/weston.socket + sudo ln -fs $(PROJECT_DIR)/system/weston.service /etc/systemd/user/weston.service + sudo ln -fs $(PROJECT_DIR)/system/weston.socket /etc/systemd/user/weston.socket systemctl --user daemon-reload systemctl --user enable weston @@ -81,4 +85,4 @@ submodule-init: .PHONY: start-weston start-weston: - /usr/bin/weston --shell=kiosk-shell.so --xwayland -- kitty --hold make -C $(PWD) run + /usr/bin/weston --shell=kiosk-shell.so --xwayland -- kitty --hold make -C $(PROJECT_DIR) run