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.

218 lines
6.4 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
include Makefile.in
5 years ago
REPO := HariSekhon/DevOps-Bash-tools
5 years ago
CODE_FILES := $(shell find . -type f -name '*.sh' -o -type f -name '.bash*' | sort)
5 years ago
CONF_FILES := $(shell sed "s/\#.*//; /^[[:space:]]*$$/d" setup/files.conf)
5 years ago
5 years ago
BASH_PROFILE_FILES := $(shell echo .bashrc .bash_profile .bash.d/*.sh)
5 years ago
#.PHONY: *
define MAKEFILE_USAGE
Repo specific options:
5 years ago
make install builds all script dependencies, installs AWS CLI, symlinks all config files to $$HOME and adds sourcing of bash profile
make link symlinks all config files to $$HOME and adds sourcing of bash profile
5 years ago
make unlink removes all symlinks pointing to this repo's config files and removes the sourcing lines from .bashrc and .bash_profile
5 years ago
make python-desktop installs all Python Pip packages for desktop workstation listed in setup/pip-packages-desktop.txt
make perl-desktop installs all Perl CPAN packages for desktop workstation listed in setup/cpan-packages-desktop.txt
make ruby-desktop installs all Ruby Gem packages for desktop workstation listed in setup/gem-packages-desktop.txt
make golang-desktop installs all Golang packages for desktop workstation listed in setup/go-packages-desktop.txt
5 years ago
5 years ago
make desktop installs all of the above + many desktop OS packages listed in setup/
5 years ago
5 years ago
make bootstrap all of the above + installs a bunch of major common workstation software packages like Ansible, Terraform, MiniKube, MiniShift, SDKman, Travis CI, CCMenu, Parquet tools etc.
5 years ago
make ls-scripts print list of scripts in this project, ignoring code libraries in lib/ and .bash.d/
make wc-scripts show line counts of the scripts and grand total
make wc-scripts2 show line counts of only scripts and total
5 years ago
make ccmenu installs and (re)configures CCMenu to watch this all other major HariSekhon repos
5 years ago
make aws installs AWS CLI tools
5 years ago
make gcp installs GCloud SDK
5 years ago
make gcp-shell sets up GCP Cloud Shell: installs core packages and links configs
5 years ago
endef
5 years ago
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 link aws
5 years ago
5 years ago
.PHONY: uninstall
uninstall: unlink
5 years ago
@echo "Not removing any system packages for safety"
5 years ago
5 years ago
.PHONY: bash
bash: link
@:
.PHONY: link
link:
@setup/shell_link.sh
.PHONY: unlink
unlink:
@setup/shell_unlink.sh
5 years ago
.PHONY: bootstrap
5 years ago
bootstrap: desktop
@setup/bootstrap.sh
5 years ago
.PHONY: bootstrap-mac
5 years ago
bootstrap-mac: desktop
5 years ago
@setup/bootstrap_mac.sh
.PHONY: bootstrap-linux
5 years ago
bootstrap-linux: desktop
5 years ago
@setup/bootstrap_linux.sh
.PHONY:
5 years ago
ccmenu:
5 years ago
@setup/configure_ccmenu.sh
.PHONY: desktop
desktop: install
@if [ -x /sbin/apk ]; then $(MAKE) apk-packages-desktop; fi
@if [ -x /usr/bin/apt-get ]; then $(MAKE) apt-packages-desktop; fi
@if [ -x /usr/bin/yum ]; then $(MAKE) yum-packages-desktop; fi
@if [ -x /usr/local/bin/brew -a `uname` = Darwin ]; then $(MAKE) homebrew-packages-desktop; fi
@# do these late so that we have the above system packages installed first to take priority and not install from source where we don't need to
5 years ago
@$(MAKE) perl-desktop
@$(MAKE) golang-desktop
@# no packages any more since jgrep is no longer found
5 years ago
@#$(MAKE) ruby-desktop
.PHONY: apk-packages-desktop
apk-packages-desktop: system-packages
@echo "Alpine desktop not supported at this time"
@exit 1
.PHONY: apt-packages-desktop
apt-packages-desktop: system-packages
5 years ago
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/apt_install_packages.sh setup/deb-packages-desktop.txt
.PHONY: yum-packages-desktop
yum-packages-desktop: system-packages
5 years ago
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/yum_install_packages.sh setup/rpm-packages-desktop.txt
.PHONY: homebrew-packages-desktop
homebrew-packages-desktop: system-packages
5 years ago
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/brew_install_packages.sh setup/brew-packages-desktop.txt
5 years ago
NO_FAIL=1 NO_UPDATE=1 CASK=1 $(BASH_TOOLS)/brew_install_packages.sh setup/brew-packages-desktop-casks.txt
5 years ago
NO_FAIL=1 NO_UPDATE=1 TAP=1 $(BASH_TOOLS)/brew_install_packages.sh setup/brew-packages-desktop-taps.txt
5 years ago
.PHONY: perl-desktop
perl-desktop: system-packages
NO_FAIL=1 NO_UPDATE=1 $(BASH_TOOLS)/perl_cpanm_install_if_absent.sh setup/cpan-packages-desktop.txt
5 years ago
.PHONY: golang-desktop
golang-desktop: system-packages
NO_FAIL=1 $(BASH_TOOLS)/golang_get_install_if_absent.sh setup/go-packages-desktop.txt
5 years ago
.PHONY: ruby-desktop
ruby-desktop: system-packages
NO_FAIL=1 $(BASH_TOOLS)/ruby_install_if_absent.sh setup/gem-packages-desktop.txt
5 years ago
.PHONY: python-desktop
python-desktop: system-packages
5 years ago
@./python_pip_install_if_absent.sh setup/pip-packages-desktop.txt
.PHONY: aws
5 years ago
aws: system-packages
5 years ago
@setup/install_aws_cli.sh
5 years ago
5 years ago
.PHONY: gcp
gcp: system-packages
@./setup/install_gcloud.sh
5 years ago
.PHONY: gcp-shell
gcp-shell: system-packages link
5 years ago
@:
9 years ago
.PHONY: test
test:
5 years ago
./check_all.sh
9 years ago
9 years ago
.PHONY: clean
9 years ago
clean:
5 years ago
@rm -fv setup/terraform.zip
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 Script files: "
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 files: "
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
@:
5 years ago
5 years ago
.PHONY: wcbashrc
wcbashrc:
@wc $(BASH_PROFILE_FILES)
@printf "Total Bash Profile files: "
@ls $(BASH_PROFILE_FILES) | wc -l
.PHONY: wcbash
wcbash: wcbashrc
@:
.PHONY: wcbashrc2
wcbashrc2:
@printf "Total Bash Profile files: "
@ls $(BASH_PROFILE_FILES) | wc -l
@printf "Total line count without # comments: "
@ls $(BASH_PROFILE_FILES) | xargs sed 's/#.*//;/^[[:space:]]*$$/d' | wc -l
.PHONY: wcbash2
wcbash2: wcbashrc2
@:
5 years ago
.PHONY: pipreqs-mapping
pipreqs-mapping:
#wget -O lib/pipreqs_mapping.txt https://raw.githubusercontent.com/HariSekhon/pipreqs/mysql-python/pipreqs/mapping
wget -O lib/pipreqs_mapping.txt https://raw.githubusercontent.com/bndr/pipreqs/master/pipreqs/mapping
.PHONY: pip-mapping
pip-mapping: pipreqs-mapping
@: