LS_COLORS/Makefile
Ryan Delaney 5e1fd9968c Sort LS_COLORS before generating
Now changing the ordering of the definitions of the LS_COLORS
file will not change the output. Thus, it's easier to know if
a reorganization of LS_COLORS made unintended changes to the
results.
2022-03-14 12:08:57 -04:00

22 lines
739 B
Makefile

FILE_NAME=lscolors
export XDG_DATA_HOME ?= $${$$HOME/.local/share}
all: generate
clean:
@command rm ${FILE_NAME}.sh 2>/dev/null || true
@command rm ${FILE_NAME}.csh 2>/dev/null || true
generate: clean
@command sort LS_COLORS | dircolors --bourne-shell - > ${FILE_NAME}.sh
@command sort LS_COLORS | dircolors --c-shell - > ${FILE_NAME}.csh
install: generate
@command cp ${FILE_NAME}.sh ${FILE_NAME}.csh ${XDG_DATA_HOME}
@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):"
@echo " source ${XDG_DATA_HOME}/${FILE_NAME}.sh"
@echo ""
@echo "For C shell (e.g. ~/.cshrc):"
@echo " source ${XDG_DATA_HOME}/${FILE_NAME}.csh"