From fa7cdc79a21bfac7da4ba591e9507d9b69d5f04a Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 23 Dec 2018 12:31:44 -0500 Subject: fixes for non-root install --- Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3f7b6d9..5148697 100755 --- a/Makefile +++ b/Makefile @@ -17,13 +17,18 @@ endif endif endif -ifneq (0,$(shell id -u)) +ifeq (0,$(shell id -u)) +optdir=/opt +bindir=/usr/local/bin +applications_dir=/usr/share/applications +alternatives=alternatives +else optdir=$(HOME)/.local/opt +bindir=$(HOME)/.local/bin applications_dir=$(HOME)/.local/share/applications +alternatives= + $(warning Warning: You are not root. Installing into $(optdir)) -else -optdir=/opt -applications_dir=/usr/share/applications endif os=linux64 @@ -42,13 +47,13 @@ tempdir=$(destdir)~tmp symlink=$(optdir)/firefox desktop_file=$(applications_dir)/firefox.desktop -global_symlink=/usr/local/bin/firefox +global_symlink=$(bindir)/firefox .DEFAULT_GOAL = install .PHONY: install $(desktop_file) $(global_symlink) alternatives beta nightly stable $(symlink) -install: $(symlink) $(desktop_file) $(global_symlink) alternatives +install: $(symlink) $(desktop_file) $(global_symlink) $(alternatives) $(global_symlink): mkdir -p $(dir $@) -- cgit v1.2.3