summaryrefslogtreecommitdiff
path: root/Makefile
blob: 7ffa644c738688da8fecdd791208dd35513281f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
DESTDIR=""  # leave empty for the current system or provide a fakeroot here
PREFIX="/usr"
PROGRAM="webiot"

.PHONY: all clean install debug

all:
	# some recommended options for Go building:
	# https://wiki.archlinux.org/title/Go_package_guidelines
	mkdir -p build
	go build -o build/$(PROGRAM) *.go

clean:
	rm -rf build

install: all
	install -Dm 755 build/$(PROGRAM) $(DESTDIR)$(PREFIX)/bin/$(PROGRAM)
	install -Dm 644 config/default.json $(DESTDIR)/etc/$(PROGRAM)/config.json
	install -Dm 644 appdata/index.html.tmpl $(DESTDIR)$(PREFIX)/share/$(PROGRAM)/index.html.tmpl
	install -Dm 644 appdata/simple.css $(DESTDIR)$(PREFIX)/share/$(PROGRAM)/simple.css

debug:
	go run *.go -c config/example.json -a appdata