2023-11-19 00:51:18 +01:00
|
|
|
export LC_ALL=C
|
2022-01-20 22:25:54 +01:00
|
|
|
FILE_NAME=lscolors
|
2023-11-19 00:37:59 +01:00
|
|
|
XDG_DATA_HOME ?= $(HOME)/.local/share
|
|
|
|
XDG_DATA_HOME := "$(XDG_DATA_HOME)"
|
2022-01-21 00:10:35 +01:00
|
|
|
all: generate
|
|
|
|
|
2022-01-20 22:25:54 +01:00
|
|
|
clean:
|
|
|
|
@command rm ${FILE_NAME}.sh 2>/dev/null || true
|
|
|
|
@command rm ${FILE_NAME}.csh 2>/dev/null || true
|
|
|
|
|
|
|
|
generate: clean
|
2022-03-14 17:08:38 +01:00
|
|
|
@command sort LS_COLORS | dircolors --bourne-shell - > ${FILE_NAME}.sh
|
|
|
|
@command sort LS_COLORS | dircolors --c-shell - > ${FILE_NAME}.csh
|
2022-01-20 22:25:54 +01:00
|
|
|
|
|
|
|
install: generate
|
2023-11-19 00:37:59 +01:00
|
|
|
@command cp ${FILE_NAME}.sh ${FILE_NAME}.csh $(XDG_DATA_HOME)
|
2022-01-20 22:25:54 +01:00
|
|
|
@echo "To enable the colors, add the following line to your shell's start-up script:"
|
|
|
|
@echo ""
|
|
|
|
@echo "For Bourne shell (e.g. ~/.bashrc or ~/.zshrc):"
|
2023-11-19 00:37:59 +01:00
|
|
|
@echo " source $(XDG_DATA_HOME)/${FILE_NAME}.sh"
|
2022-01-20 22:25:54 +01:00
|
|
|
@echo ""
|
|
|
|
@echo "For C shell (e.g. ~/.cshrc):"
|
2023-11-19 00:37:59 +01:00
|
|
|
@echo " source $(XDG_DATA_HOME)/${FILE_NAME}.csh"
|