From 592e4c3a5520172e42e8f7174cf66115175434e6 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 21 May 2023 20:54:23 +0200 Subject: Rework Makefile completely --- Makefile | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0af1ed6..2fa55ae 100644 --- a/Makefile +++ b/Makefile @@ -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) -- cgit v1.2.3-70-g09d2