From d3a9a879d2b064e33d30779774896c69a4423cb6 Mon Sep 17 00:00:00 2001 From: girst Date: Fri, 27 Dec 2019 07:21:49 +0100 Subject: [PATCH] provide clean and uninstall targets, auto-find correct path The wildcard will match both /usr/lib and /usr/lib64, so the Makefile works on 99% of Linux distros. And yes, that's not what DESTDIR is for. --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1dccb57..9c41ab3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: all install +.PHONY: all clean install uninstall files := config.js files += defaults/pref/config-prefs.js @@ -7,11 +7,17 @@ files += legacy/BootstrapLoader.jsm files += legacy/RDFDataSource.jsm files += legacy/RDFManifestConverter.jsm archive = legacyfox.tar.gz -mozilladir = /usr/lib64/firefox/ +DESTDIR ?= $(wildcard /usr/lib??/firefox/) all: $(archive) $(archive): $(files) tar czf $@ -- $(files) +clean: + rm -f $(archive) + install: $(archive) - tar xzf $(archive) -C $(mozilladir) + tar xzf $(archive) -C "$(DESTDIR)" + +uninstall: + cd "$(DESTDIR)" && rm -rf -- $(files) -- 2.39.3