summaryrefslogtreecommitdiff
path: root/Makefile
blob: c6e9352e3c29281e36807fa9fd0c491cb65a24db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
DESTDIR=  # leave empty for the current system or provide a fakeroot here
PREFIX=/usr
INSTALLATION=$(DESTDIR)$(PREFIX)
BUILDDIR=build

LIMOX_GO_PACKAGE=xengineering.eu/limox
LIMOX=$(BUILDDIR)/limox
LIMOX_INSTALL=$(INSTALLATION)/bin/limox

DESKTOP_SRC=limox.desktop
DESKTOP=$(BUILDDIR)/$(DESKTOP_SRC)
DESKTOP_INSTALL=$(INSTALLATION)/share/applications/$(DESKTOP_SRC)


all: $(LIMOX) $(DESKTOP) tests

$(BUILDDIR):
	mkdir $@

$(LIMOX): $(BUILDDIR) tests
	go build -o $@ $(LIMOX_GO_PACKAGE)

$(DESKTOP): $(BUILDDIR)
	cp $(DESKTOP_SRC) $@


.PHONY: clean debug install tests

clean:
	rm -rf $(BUILDDIR)

debug:
	go run $(LIMOX_GO_PACKAGE)

install: $(LIMOX)
	install -Dm 755 $(LIMOX) $(LIMOX_INSTALL)
	install -Dm 644 $(DESKTOP) $(DESKTOP_INSTALL)

tests:
	go test ./...