Files
ArmA-3-web-server/Makefile
MrFastwind 914e0fbe48
Some checks failed
CI / build (push) Failing after 3s
Make deployment-friendly defaults: no env vars needed to run
- Go binary defaults DATA_DIR=./data, SERVERFILE_DIR=./serverfiles
  (relative to cwd) — just copy the binary and run
- MODS_DIR, CFG_DIR, PROFILES_DIR are derived from SERVERFILE_DIR
- Removed DEV_DEPLOY_DIR indirection (was only used for development)
- Makefile expands defaults to ../dev-deploy/... directly for dev
2026-07-09 15:42:54 +02:00

36 lines
1.1 KiB
Makefile

.PHONY: backend frontend build run clean dev
# Default paths for dev — override via env
SERVERFILE_DIR ?= ../dev-deploy/serverfiles
MODS_DIR ?= ../dev-deploy/serverfiles/mods
CFG_DIR ?= ../dev-deploy/serverfiles/cfg
PROFILES_DIR ?= ../dev-deploy/serverfiles/profiles
DATA_DIR ?= ../dev-deploy/data
backend:
cd backend && go build -o arma3-web-server ./cmd/server/
frontend:
cd frontend && npm run build
.PHONY: copyfrontend
copyfrontend:
rm -rf backend/embed/dist
mkdir -p backend/embed/dist
cp -r frontend/dist/. backend/embed/dist/
build: frontend copyfrontend backend
run:
cd backend && SERVERFILE_DIR=$(SERVERFILE_DIR) MODS_DIR=$(MODS_DIR) CFG_DIR=$(CFG_DIR) PROFILES_DIR=$(PROFILES_DIR) DATA_DIR=$(DATA_DIR) GIN_MODE=debug go run ./cmd/server/
dev:
mkdir -p backend/embed/dist
test -f backend/embed/dist/dev.txt || touch backend/embed/dist/dev.txt
cd backend && SERVERFILE_DIR=$(SERVERFILE_DIR) MODS_DIR=$(MODS_DIR) CFG_DIR=$(CFG_DIR) PROFILES_DIR=$(PROFILES_DIR) DATA_DIR=$(DATA_DIR) GIN_MODE=debug go run ./cmd/server/ &
cd frontend && npm run dev
clean:
rm -f backend/arma3-web-server
rm -rf frontend/dist backend/embed/dist