aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2025-07-08 23:26:05 +0100
committerLeonardo Bishop <me@leonardobishop.net>2025-07-08 23:26:05 +0100
commitcdb75d3fcbc9339b897f8c6ff4d69a577f017393 (patch)
tree5e757cd236540c2cea9874c1bc09f19548db05d5 /Makefile
parentb56101f1a11552067f594679a497ebd4cf7427d4 (diff)
Rewrite in Go
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 18 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..2a9c96b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,18 @@
+BINARY_NAME=scrapbook
+SYS_CONF_DIR=/etc/scrapbook
+SYS_CONF_DIR=/var/lib/scrapbook
+
+all: build
+
+build:
+ go build -ldflags "-X 'github.com/LMBishop/scrapbook/pkg/constants.SysConfDir=${SYS_CONF_DIR}' -X 'github.com/LMBishop/scrapbook/pkg/constants.SysDataDir=${SYS_DATA_DIR}'" -o ${BINARY_NAME} main.go
+
+runlocal:
+ PWD=$(shell pwd)
+ mkdir -p out
+ go build -ldflags "-X 'github.com/LMBishop/scrapbook/pkg/constants.SysConfDir=${PWD}/out/config' -X 'github.com/LMBishop/scrapbook/pkg/constants.SysDataDir=${PWD}/out/data'" -o out/${BINARY_NAME} main.go
+ cd out; ./${BINARY_NAME}
+
+clean:
+ go clean
+ rm ${BINARY_NAME} \ No newline at end of file