aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-03-22 00:02:21 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-03-22 00:02:21 -0400
commit8e020b13432a2ca1db201d3053dc34dd1c0dad91 (patch)
treeb8e4ef1d71ff8803afb57837e706d60226247d3c
parent1a2327eb65f205f5cab2296a3a4589557d48e47c (diff)
Add some logic to check for a GCC version high enough
-rw-r--r--Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 29bc7221..31f91635 100644
--- a/Makefile
+++ b/Makefile
@@ -81,9 +81,19 @@ examples: examples/commands/commands examples/base64/base64 examples/ini/ini exa
examples/http examples/threads examples/tomodeps examples/tomo-install examples/wrap examples/pthreads examples/colorful
./build/tomo examples/learnxiny.tm
-deps:
+deps: check-gcc
./install_dependencies.sh
+check-gcc:
+ @GCC_VERSION=$$(gcc --version | awk '{print $$3;exit}'); \
+ if [ "$$(printf '%s\n' "$$GCC_VERSION" "12.0.0" | sort -V | head -n 1)" = "12.0.0" ]; then \
+ printf "\033[32;1mGCC version is good!\033[m\n"; \
+ exit 0; \
+ else \
+ printf "\033[31;1mGCC version is lower than the required 12.0.0!\033[m\n" >&2; \
+ exit 1; \
+ fi
+
install: build/tomo build/libtomo.so
@if ! echo "$$PATH" | tr ':' '\n' | grep -qx "$(PREFIX)/bin"; then \
printf "\033[31;1mError: '$(PREFIX)' is not in your \$$PATH variable!\033[m\n" >&2; \
@@ -103,4 +113,4 @@ uninstall:
rm -rvf "$(PREFIX)/bin/tomo" "$(PREFIX)/include/tomo" "$(PREFIX)/lib/libtomo.so" "$(PREFIX)/share/tomo"; \
.SUFFIXES:
-.PHONY: all clean install uninstall test tags examples deps
+.PHONY: all clean install uninstall test tags examples deps check-gcc