aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorr <r@freesoftwareextremist.com>2020-01-31 18:18:31 +0000
committerr <r@freesoftwareextremist.com>2020-01-31 18:18:31 +0000
commitcd9306294d18d0b357fae3c1894b4f3f2d14c9c0 (patch)
tree925e8e10a0eb58ae689726a8bf6ffada949a16d3 /Makefile
parenta981085260af2623bd4988e4b9c0052e2e3035eb (diff)
downloadbloat-cd9306294d18d0b357fae3c1894b4f3f2d14c9c0.tar.gz
bloat-cd9306294d18d0b357fae3c1894b4f3f2d14c9c0.zip
Add install target for make
- Update default config path accordingly - Mention use of config file in README
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 24 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 780f6e8..2ebd9df 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,32 @@
GO=go
+BINPATH=/usr/local/bin
+DATAPATH=/var/bloat
+ETCPATH=/etc
all: bloat
-PHONY:
-
-bloat: main.go PHONY
+bloat: main.go
$(GO) build $(GOFLAGS) -o bloat main.go
+install: bloat
+ cp bloat $(BINPATH)/bloat
+ chmod 0755 $(BINPATH)/bloat
+ mkdir -p $(DATAPATH)/database
+ cp -r templates $(DATAPATH)/
+ cp -r static $(DATAPATH)/
+ sed -e "s%=database%=$(DATAPATH)/database%g" \
+ -e "s%=templates%=$(DATAPATH)/templates%g" \
+ -e "s%=static%=$(DATAPATH)/static%g" \
+ < bloat.conf > $(ETCPATH)/bloat.conf
+
+uninstall:
+ rm -f $(BINPATH)/bloat
+ rm -fr $(DATAPATH)/templates
+ rm -fr $(DATAPATH)/static
+ rm -f $(ETCPATH)/bloat.conf
+
+clean:
+ rm -f bloat
+
run: bloat
./bloat