From 0efc0121906da107f7f5b2805aaa5185d3babf00 Mon Sep 17 00:00:00 2001 From: "NABLA\" d.o.o. Zenica" Date: Tue, 23 Sep 2025 15:44:01 +0200 Subject: [PATCH] Initial commit --- makefile | 15 +++++++++++++++ service/.gitignore | 1 + service/makefile | 13 +++++++++++++ web/makefile | 5 +++++ 4 files changed, 34 insertions(+) create mode 100644 makefile create mode 100644 service/.gitignore create mode 100644 service/makefile create mode 100644 web/makefile diff --git a/makefile b/makefile new file mode 100644 index 0000000..a58d617 --- /dev/null +++ b/makefile @@ -0,0 +1,15 @@ +# Service-related +SERVICE_DIR ?= ./service +SERVICE_LIST := $(notdir $(wildcard $(SERVICE_DIR)/cmd/*)) + +$(SERVICE_LIST:%=run-%) $(SERVICE_LIST:%=build-%): + @$(MAKE) -C $(SERVICE_DIR) $@ + +# Web-related +WEB_DIR ?= ./web +WEB_LIST := $(shell jq -r ".scripts|keys[]" $(WEB_DIR)/package.json 2>/dev/null) + +$(WEB_LIST:%=web-%): + @$(MAKE) -C $(WEB_DIR) $@ + +.PHONY: % diff --git a/service/.gitignore b/service/.gitignore new file mode 100644 index 0000000..ba077a4 --- /dev/null +++ b/service/.gitignore @@ -0,0 +1 @@ +bin diff --git a/service/makefile b/service/makefile new file mode 100644 index 0000000..3a31714 --- /dev/null +++ b/service/makefile @@ -0,0 +1,13 @@ +# Sane build defaults +CGO_ENABLED ?= 0 +LDFLAGS ?= "-s -w" + +run-%: + @go run \ + cmd/$*/main.go + +build-%: + @CGO_ENABLED=$(CGO_ENABLED) go build \ + -ldflags $(LDFLAGS) -o bin/$* cmd/$*/main.go + +.PHONY: % diff --git a/web/makefile b/web/makefile new file mode 100644 index 0000000..7d89ffe --- /dev/null +++ b/web/makefile @@ -0,0 +1,5 @@ +%: + @pnpm run \ + $(@:web-%=%) + +.PHONY: %