From caa5c052ecd306355159f65f4b026d312c62b9ab Mon Sep 17 00:00:00 2001 From: philsmd Date: Fri, 26 Jan 2018 08:20:12 +0100 Subject: [PATCH] Makefile: disallow running 'make install' on windows systems (including cygwin/msys etc) --- src/Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Makefile b/src/Makefile index 466c2875d..5451b3c33 100644 --- a/src/Makefile +++ b/src/Makefile @@ -334,6 +334,19 @@ win64: hashcat64.exe ## How to make /usr/bin/install doing recursive?? ## +# allow (whitelist) "make install" only on unix-based systems (also disallow cygwin/msys) + +ifneq ($(findstring install,$(MAKECMDGOALS)),) + ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin)) + define ERROR_INSTALL_DISALLOWED +! The 'install' target is not allowed on this operating system ($(UNAME)). \ +Only Linux, FreeBSD and Darwin can use the 'install' target + endef + + $(error $(ERROR_INSTALL_DISALLOWED)) + endif +endif + ifeq ($(SHARED),1) install: install_docs install_shared install_include install_library install_hashcat else