You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.1 KiB
Makefile

9 years ago
#
# Author: Hari Sekhon
# Date: 2016-01-17 12:56:53 +0000 (Sun, 17 Jan 2016)
#
# vim:ts=4:sts=4:sw=4:noet
#
# https://github.com/harisekhon/bash-tools
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback
#
# https://www.linkedin.com/in/harisekhon
9 years ago
#
5 years ago
REPO := HariSekhon/DevOps-Bash-tools
5 years ago
CODE_FILES := $(shell find . -type f -name '*.sh' -o -name '.bash*' | sort)
5 years ago
5 years ago
CONF_FILES := \
.ansible.cfg \
.editorconfig \
5 years ago
.gitconfig \
5 years ago
.gitignore \
5 years ago
.my.cnf \
5 years ago
.screenrc \
5 years ago
.toprc \
5 years ago
.tmux.conf \
5 years ago
.vimrc \
5 years ago
.Xdefaults \
5 years ago
.Xmodmap
5 years ago
6 years ago
include Makefile.in
9 years ago
.PHONY: build
5 years ago
build: system-packages aws
5 years ago
@:
9 years ago
5 years ago
.PHONY: install
5 years ago
install: build bash python aws
5 years ago
5 years ago
.PHONY: uninstall
uninstall: bash-unlink
5 years ago
@echo "Not removing any system packages for safety"
5 years ago
5 years ago
.PHONY: bash
bash:
5 years ago
@setup/setup_bash.sh
5 years ago
@echo "linking dot files to \$$HOME directory: $$HOME"
5 years ago
@f=""; [ -n "$$FORCE" ] && f="-f"; \
5 years ago
for filename in $(CONF_FILES); do \
5 years ago
ln -sv $$f "$$PWD/$$filename" ~ 2>/dev/null; \
done || :
@ln -sv $$f ~/.gitignore ~/.gitignore_global 2>/dev/null || :
5 years ago
5 years ago
.PHONY: bash-unlink
bash-unlink:
@for filename in $(CONF_FILES) .gitignore_global; do \
if [ -L ~/"$$filename" ]; then \
rm -fv ~/"$$filename"; \
fi; \
done || :
@echo "Must manually remove sourcing from ~/.bashrc and ~/.bash_profile"
5 years ago
.PHONY: python
python:
@./python_pip_install_if_absent.sh setup/pip-packages-desktop.txt
.PHONY: aws
5 years ago
aws:
@./python_pip_install_if_absent.sh awscli
5 years ago
9 years ago
.PHONY: test
test:
./all.sh
9 years ago
.PHONY: clean
9 years ago
clean:
@echo Nothing to clean
5 years ago
5 years ago
.PHONY: ls-scripts
ls-scripts:
@$(MAKE) ls-code | grep -v -e '/kafka_wrappers/' -e '/lib/' -e '\.bash'
5 years ago
5 years ago
.PHONY: lsscripts
lsscripts: ls-scripts
@:
.PHONY: wc-scripts
wc-scripts:
@$(MAKE) ls-scripts | xargs wc -l
5 years ago
@printf "Total Scripts: "
5 years ago
@$(MAKE) ls-scripts | wc -l
5 years ago
5 years ago
.PHONY: wcscripts
wcscripts: wc-scripts
@:
.PHONY: wc-scripts2
wc-scripts2:
5 years ago
@printf "Total Scripts: "
5 years ago
@$(MAKE) ls-scripts | wc -l
5 years ago
@printf "Total line count without # comments: "
5 years ago
@$(MAKE) ls-scripts | xargs sed 's/#.*//;/^[[:space:]]*$$/d' | wc -l
.PHONY: wcscripts2
wcscripts2: wc-scripts2
@: