# BastionGuard™ Secure Connection — top-level Makefile
# Wrapper di conveniencia attorno a meson/ninja. Il build system reale
# e' meson: vedere README.md per i comandi nativi.

BUILD_DIR ?= build
PREFIX    ?= /usr
SYSCONFDIR ?= /etc

.PHONY: all setup compile install clean run uninstall

all: compile

setup:
	meson setup $(BUILD_DIR) \
		--prefix=$(PREFIX) \
		--sysconfdir=$(SYSCONFDIR) \
		--localedir=share/locale \
		--reconfigure 2>/dev/null || \
	meson setup $(BUILD_DIR) \
		--prefix=$(PREFIX) \
		--sysconfdir=$(SYSCONFDIR) \
		--localedir=share/locale

compile: setup
	meson compile -C $(BUILD_DIR)

install: compile
	sudo meson install -C $(BUILD_DIR)

uninstall:
	sudo ninja -C $(BUILD_DIR) uninstall

clean:
	rm -rf $(BUILD_DIR)

run: compile
	BSC_DATA=ui/data $(BUILD_DIR)/ui/bastionguard-sc-ui
