diff options
-rw-r--r-- | Makefile | 35 |
1 files changed, 25 insertions, 10 deletions
@@ -1,22 +1,37 @@ DESTDIR= # leave empty for the current system or provide a fakeroot here PREFIX=/usr +INSTALLATION=$(DESTDIR)$(PREFIX) +BUILDDIR=build -all: build/limox +LIMOX_GO_PACKAGE=xengineering.eu/limox +LIMOX=$(BUILDDIR)/limox +LIMOX_INSTALL=$(INSTALLATION)/bin/limox -build: - mkdir build +DESKTOP_SRC=limox.desktop +DESKTOP=$(BUILDDIR)/$(DESKTOP_SRC) +DESKTOP_INSTALL=$(INSTALLATION)/share/applications/$(DESKTOP_SRC) + + +all: $(LIMOX) $(DESKTOP) + +$(BUILDDIR): + mkdir $@ + +$(LIMOX): $(BUILDDIR) + go build -o $@ $(LIMOX_GO_PACKAGE) + +$(DESKTOP): $(BUILDDIR) + cp $(DESKTOP_SRC) $@ -build/limox: build - go build -o $@ xengineering.eu/limox .PHONY: clean debug install clean: - rm -rf build + rm -rf $(BUILDDIR) debug: - go run ./... + go run $(LIMOX_GO_PACKAGE) -install: build/limox - install -Dm 755 build/limox $(DESTDIR)$(PREFIX)/bin/limox - install -Dm 644 limox.desktop $(DESTDIR)$(PREFIX)/share/applications/limox.desktop +install: $(LIMOX) + install -Dm 755 $(LIMOX) $(LIMOX_INSTALL) + install -Dm 644 $(DESKTOP) $(DESKTOP_INSTALL) |