diff options
author | xengineering <me@xengineering.eu> | 2023-05-21 20:54:23 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-05-21 20:54:23 +0200 |
commit | 592e4c3a5520172e42e8f7174cf66115175434e6 (patch) | |
tree | d090b51ea0cb16ecc0b527aede1fd46364173fb1 /Makefile | |
parent | 50618675c84d2246f48a18de206200d27a733300 (diff) | |
download | limox-592e4c3a5520172e42e8f7174cf66115175434e6.tar limox-592e4c3a5520172e42e8f7174cf66115175434e6.tar.zst limox-592e4c3a5520172e42e8f7174cf66115175434e6.zip |
Rework Makefile completely
Diffstat (limited to 'Makefile')
-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) |