From 51071dc4cf0d34a36d75debd4d8fe2658b287ad3 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sun, 3 Jan 2021 23:49:32 -0800 Subject: [PATCH] Simplify makefile [skip ci] --- Makefile | 34 ++++++++-------------------------- install-config.sh | 2 -- 2 files changed, 8 insertions(+), 28 deletions(-) delete mode 100644 install-config.sh diff --git a/Makefile b/Makefile index c1091b9..6db8ba3 100644 --- a/Makefile +++ b/Makefile @@ -1,33 +1,15 @@ GOBUILD ?= go build -pak: main.go +all: main.go $(GOBUILD) +install: PAK_CFG_MGR ?= apt +install: pak.toml pak + install -Dm755 pak $(DESTDIR)/usr/bin/pak + sed 's/activeManager = ""/activeManager = "$(PAK_CFG_MGR)"/' pak.toml > pak-new.toml + install -Dm644 pak-new.toml $(DESTDIR)/etc/pak.toml + installbinonly: pak install -Dm755 pak $(DESTDIR)/usr/bin/pak -aptinstall: install-config.sh pak.toml pak - install -Dm644 pak.toml $(DESTDIR)/etc/pak.toml - bash install-config.sh apt $(DESTDIR) - -snapinstall: install-config.sh pak.toml pak - install -Dm755 pak $(DESTDIR)/usr/bin/pak - bash install-config.sh snap $(DESTDIR) - -yayinstall: install-config.sh pak.toml pak - install -Dm755 pak $(DESTDIR)/usr/bin/pak - bash install-config.sh yay $(DESTDIR) - -pacinstall: install-config.sh pak.toml pak - install -Dm755 pak $(DESTDIR)/usr/bin/pak - bash install-config.sh pacman $(DESTDIR) - -aptitude: install-config.sh pak.toml pak - install -Dm755 pak $(DESTDIR)/usr/bin/pak - bash install-config.sh aptitude $(DESTDIR) - -brewinstall: install-config.sh pak.toml pak - install -Dm755 pak $(DESTDIR)/usr/bin/pak - bash install-config.sh brew $(DESTDIR) - -.PHONY: pak $(MAKECMDGOALS) +.PHONY: all install installbinonly diff --git a/install-config.sh b/install-config.sh deleted file mode 100644 index d3f7487..0000000 --- a/install-config.sh +++ /dev/null @@ -1,2 +0,0 @@ -sed "s/activeManager = \"\"/activeManager = \"$1\"/" pak.toml > pak-new.toml -install -Dm644 pak-new.toml "$2"/etc/pak.toml \ No newline at end of file