From 11361930912c43a563a461573f7df57b71351124 Mon Sep 17 00:00:00 2001 From: Andrea Rogers Date: Tue, 4 Mar 2025 13:15:10 -0600 Subject: [PATCH] Makefile: Add system-wide bashrc target for Linux This fixes login shells on Arch Linux. Hopefully it fixes others, as well. --- GNUmakefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index bb7b473..721288b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -6,6 +6,7 @@ DEFAULT_TARGETS += $(HOME)/.bash_profile \ $(HOME)/.profile.d profileds ALIASES = $(foreach a,$(wildcard .aliases/*),$(subst .aliases/,$(HOME)/.aliases/,$(a))) PROFILEDS = $(foreach p,$(wildcard .profile.d/*),$(subst .profile.d/,$(HOME)/.profile.d/,$(p))) +DOSU ?= $(shell command -v sudo || which doas) UNAME = $(shell uname -s) ifeq ($(UNAME),Darwin) @@ -60,6 +61,9 @@ $(HOME)/.profile.%: .profile.% $(HOME)/.bashrc: .bashrc cp $< $@ +/etc/bash.bashrc: .bashrc + $(DOSU) cp $< $@ + $(HOME)/.inputrc: .inputrc cp $< $@ @@ -67,10 +71,10 @@ $(HOME)/.bashrc.%: .bashrc.% cp $< $@ /opt/local/etc/bashrc: .bashrc - sudo cp $< $@ + $(DOSU) cp $< $@ /opt/local/etc/bashrc.%: .bashrc.% - sudo cp $< $@ + $(DOSU) cp $< $@ ### TERMINAL EMULATOR ##########################################################