aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
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