Initial commit

This commit is contained in:
NABLA" d.o.o. Zenica
2025-09-23 15:44:01 +02:00
commit 0efc012190
4 changed files with 34 additions and 0 deletions

15
makefile Normal file
View File

@@ -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: %

1
service/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
bin

13
service/makefile Normal file
View File

@@ -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: %

5
web/makefile Normal file
View File

@@ -0,0 +1,5 @@
%:
@pnpm run \
$(@:web-%=%)
.PHONY: %