diff --git a/example/base/Makefile b/example/base/Makefile index fb270d3..ca98dfa 100644 --- a/example/base/Makefile +++ b/example/base/Makefile @@ -12,14 +12,24 @@ ifeq ($(shell uname),Darwin) @echo "Setting up shellcheck (macOS)..." brew install shellcheck +else ifeq ($(shell uname -s),Linux) +ifeq ($(shell uname -m),x86_64) + @echo "Setting up shfmt for amd64 (Linux)..." + wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64" +else ifeq ($(shell uname -m),aarch64) + @echo "Setting up shfmt for arm64 (Linux)..." + wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_arm64" else - @echo "Setting up shfmt (Linux)..." - wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_$(shell uname -m)" + @echo "Unsupported architecture $(shell uname -m)! Update this Makefile!" + exit 1 +endif chmod +x shfmt - sudo mv shfmt /usr/local/bin/ - + sudo mv shfmt /usr/local/bin/shfmt @echo "Setting up shellcheck (Linux)..." sudo apt-get install shellcheck || sudo yum install shellcheck || sudo dnf install shellcheck +else + @echo "Unsupported operating system! Update this Makefile or use macOS/Linux." + exit 1 endif .PHONY: reqtxt diff --git a/example/python/Makefile b/example/python/Makefile index fb270d3..ca98dfa 100644 --- a/example/python/Makefile +++ b/example/python/Makefile @@ -12,14 +12,24 @@ ifeq ($(shell uname),Darwin) @echo "Setting up shellcheck (macOS)..." brew install shellcheck +else ifeq ($(shell uname -s),Linux) +ifeq ($(shell uname -m),x86_64) + @echo "Setting up shfmt for amd64 (Linux)..." + wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64" +else ifeq ($(shell uname -m),aarch64) + @echo "Setting up shfmt for arm64 (Linux)..." + wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_arm64" else - @echo "Setting up shfmt (Linux)..." - wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_$(shell uname -m)" + @echo "Unsupported architecture $(shell uname -m)! Update this Makefile!" + exit 1 +endif chmod +x shfmt - sudo mv shfmt /usr/local/bin/ - + sudo mv shfmt /usr/local/bin/shfmt @echo "Setting up shellcheck (Linux)..." sudo apt-get install shellcheck || sudo yum install shellcheck || sudo dnf install shellcheck +else + @echo "Unsupported operating system! Update this Makefile or use macOS/Linux." + exit 1 endif .PHONY: reqtxt diff --git a/example/rust/Makefile b/example/rust/Makefile index fb270d3..ca98dfa 100644 --- a/example/rust/Makefile +++ b/example/rust/Makefile @@ -12,14 +12,24 @@ ifeq ($(shell uname),Darwin) @echo "Setting up shellcheck (macOS)..." brew install shellcheck +else ifeq ($(shell uname -s),Linux) +ifeq ($(shell uname -m),x86_64) + @echo "Setting up shfmt for amd64 (Linux)..." + wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64" +else ifeq ($(shell uname -m),aarch64) + @echo "Setting up shfmt for arm64 (Linux)..." + wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_arm64" else - @echo "Setting up shfmt (Linux)..." - wget -qO shfmt "https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_$(shell uname -m)" + @echo "Unsupported architecture $(shell uname -m)! Update this Makefile!" + exit 1 +endif chmod +x shfmt - sudo mv shfmt /usr/local/bin/ - + sudo mv shfmt /usr/local/bin/shfmt @echo "Setting up shellcheck (Linux)..." sudo apt-get install shellcheck || sudo yum install shellcheck || sudo dnf install shellcheck +else + @echo "Unsupported operating system! Update this Makefile or use macOS/Linux." + exit 1 endif .PHONY: reqtxt