From edf89db6fc28931ca59f6c9acfd0a561d68145c7 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 19 Aug 2025 15:32:17 +0200 Subject: add discard2 icon and button to trigger the free action --- go/Makefile | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) (limited to 'go/Makefile') diff --git a/go/Makefile b/go/Makefile index ced2e223..879cb8c0 100644 --- a/go/Makefile +++ b/go/Makefile @@ -1,7 +1,16 @@ -PACKAGES := activities assets client dummy-ui game log server +# The full path to the Makefile +MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) +# The path to the directory of the Makefile +MAKEFILE_DIR := $(realpath $(dir $(MAKEFILE_PATH))) + +ASSETSROOT = $(MAKEFILE_DIR)/../assets/ +ASSETS = $(wildcard $(ASSETSROOT)/icons/*) +ASSETSTOCOPY = $(addprefix assets/,$(ASSETS:$(ASSETSROOT)/%=copy/%)) SHELL := bash +PACKAGES := activities assets client dummy-ui game log server + APPS := server client dummy-ui OBJS := $(foreach app,$(APPS),$(app)/$(app)) WASM := client/client.wasm webtools/webtools.wasm dummy-ui/dummy-ui.wasm @@ -21,21 +30,28 @@ client: client/client server: server/server dummy-ui: dummy-ui/dummy-ui -$(OBJS): - @echo Building $(@F) - @pushd $(@D) >/dev/null && go build $(GO_BUILDTAGS) && popd >/dev/null +VERBOSE ?= @ + +assets/copy/%: $(ASSETSROOT)/% + $(VERBOSE)echo Copying asset $(@F) + $(VERBOSE)if test \( ! \( -d $(@D) \) \); then mkdir -p $(@D);fi + $(VERBOSE)cp $< $@ + +$(OBJS): $(ASSETSTOCOPY) + $(VERBOSE)echo Building $(@F) + $(VERBOSE)pushd $(@D) >/dev/null && go build $(GO_BUILDTAGS) && popd >/dev/null -$(WASM): - @echo Building $(@F) ... - @pushd $(@D) >/dev/null && env GOOS=js GOARCH=wasm go build $(GO_BUILDTAGS) -o $(@F) && popd >/dev/null +$(WASM): $(ASSETSTOCOPY) + $(VERBOSE)echo Building $(@F) ... + $(VERBOSE)pushd $(@D) >/dev/null && env GOOS=js GOARCH=wasm go build $(GO_BUILDTAGS) -o $(@F) && popd >/dev/null fmt: - @set -e; for package in $(PACKAGES) webtools; do \ + $(VERBOSE)set -e; for package in $(PACKAGES) webtools; do \ pushd $$package >/dev/null && $(GOFMT); popd >/dev/null; \ done test: - @STATUS=0; \ + $(VERBOSE)STATUS=0; \ for package in $(PACKAGES); do \ if pushd "$$package" >/dev/null; then \ go test; \ @@ -47,7 +63,7 @@ test: exit "$$STATUS" check: - @STATUS=0; \ + $(VERBOSE)STATUS=0; \ for package in $(PACKAGES); do \ if pushd "$$package" >/dev/null; then \ golangci-lint run; \ -- cgit v1.2.3