commit acc58087730bd5313dd26550aa9a2cebe362cb28 parent da47e055bac63e2d23e18f15c7fca1b7b7a554cd Author: Chris Bracken <chris@bracken.jp> Date: Sun, 20 Oct 2019 14:59:21 -0700 Make Makefile POSIX-compliant Makes a few changes: * Eliminates use of GNU make extensions such as MAKEFILES_LIST * Adds a .POSIX: as the first non-comment line to get POSIX behaviour * Adds a .PHONY target listing all targets to ensure they always run Diffstat:
M | Makefile | | | 56 | ++++++++++++++++++++++++++++++-------------------------- |
1 file changed, 30 insertions(+), 26 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,40 +1,44 @@ -mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST))) -mkfile_dir := $(patsubst %/,%,$(dir $(mkfile_path))) +.POSIX: + +# path to this repo +REPO_DIR=src/cfg/dotfiles # shells install-zsh: - ln -s "$(mkfile_dir)/.aliases" ~/ - ln -s "$(mkfile_dir)/.colors" ~/ - ln -s "$(mkfile_dir)/.paths" ~/ - ln -s "$(mkfile_dir)/.sh_functions" ~/ - ln -s "$(mkfile_dir)/.zlogin" ~/ - ln -s "$(mkfile_dir)/.zlogout" ~/ - ln -s "$(mkfile_dir)/.zprofile" ~/ - ln -s "$(mkfile_dir)/.zshenv" ~/ - ln -s "$(mkfile_dir)/.zshrc" ~/ + ln -s "$(REPO_DIR)/.aliases" ~/ + ln -s "$(REPO_DIR)/.colors" ~/ + ln -s "$(REPO_DIR)/.paths" ~/ + ln -s "$(REPO_DIR)/.sh_functions" ~/ + ln -s "$(REPO_DIR)/.zlogin" ~/ + ln -s "$(REPO_DIR)/.zlogout" ~/ + ln -s "$(REPO_DIR)/.zprofile" ~/ + ln -s "$(REPO_DIR)/.zshenv" ~/ + ln -s "$(REPO_DIR)/.zshrc" ~/ + +# program config +install-git: + ln -s "$(REPO_DIR)/.gitconfig" ~/ + ln -s "$(REPO_DIR)/.gitignore_global" ~/ + ln -s "$(REPO_DIR)/.tigrc" ~/ + +install-tmux: + ln -s "$(REPO_DIR)/.tmux.conf" ~/ install-x: - ln -s "$(mkfile_dir)/.Xdefaults" ~/ - ln -s "$(mkfile_dir)/.Xmodmap" ~/ + ln -s "$(REPO_DIR)/.Xdefaults" ~/ + ln -s "$(REPO_DIR)/.Xmodmap" ~/ install-fontconf: - ln -s "$(mkfile_dir)/.fonts.conf" ~/ + ln -s "$(REPO_DIR)/.fonts.conf" ~/ fc-cache -f -v -# program config -install-git: - ln -s "$(mkfile_dir)/.gitconfig" ~/ - ln -s "$(mkfile_dir)/.gitignore_global" ~/ - ln -s "$(mkfile_dir)/.tigrc" ~/ - install-astyle: - ln -s "$(mkfile_dir)/.astylerc" ~/ + ln -s "$(REPO_DIR)/.astylerc" ~/ install-irssi: - ln -s "$(mkfile_dir)/.irssi" ~/ - -install-tmux: - ln -s "$(mkfile_dir)/.tmux.conf" ~/ + ln -s "$(REPO_DIR)/.irssi" ~/ install-screen: - ln -s "$(mkfile_dir)/.screenrc" ~/ + ln -s "$(REPO_DIR)/.screenrc" ~/ + +.PHONY: install-zsh install-git install-tmux install-x install-fontconf install-astyle install-irssi install-screen