Initial commit
This commit is contained in:
15
makefile
Normal file
15
makefile
Normal 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
1
service/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
bin
|
||||
13
service/makefile
Normal file
13
service/makefile
Normal 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
5
web/makefile
Normal file
@@ -0,0 +1,5 @@
|
||||
%:
|
||||
@pnpm run \
|
||||
$(@:web-%=%)
|
||||
|
||||
.PHONY: %
|
||||
Reference in New Issue
Block a user