From 5e52f2086707fa7bc7ec16355a65aa2f112f3fab Mon Sep 17 00:00:00 2001 From: gum0x Date: Thu, 9 Feb 2017 01:49:01 +0100 Subject: [PATCH 1/2] * Added Darwin OS version conditional in order to use sed instead of gsed if OS version is macOS Sierra (v16). * Added a SEDOPS variable in order to manage BSD sed command syntax. BSD sed need explicitily especify a parametre for -i option. --- src/Makefile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index 263c89eed..7dd497b8c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,6 +16,11 @@ UNAME := $(shell uname -s) # we need to strip the windows version number to be able to build hashcat on cygwin hosts UNAME := $(patsubst CYGWIN_NT-%,CYGWIN,$(UNAME)) +## +## Detect Operating System version +## +OSVERSION := $(shell uname -r|cut -d. -f1) + # same for msys UNAME := $(patsubst MSYS_NT-%,MSYS2,$(UNAME)) UNAME := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME)) @@ -85,11 +90,18 @@ FIND := find INSTALL := install RM := rm SED := sed - +SEDOPS := -i ifeq ($(UNAME),Darwin) CC := clang +ifeq ($(OSVERSION),16) +SED := sed +SEDOPS := -i "" +else SED := gsed endif +endif + + ifeq ($(UNAME),FreeBSD) CC := cc @@ -353,9 +365,9 @@ install_docs: $(FIND) masks/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; $(FIND) rules/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; $(FIND) rules/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(SED) -i 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example0.sh - $(SED) -i 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh - $(SED) -i 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh + $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example0.sh + $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh + $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh install_shared: $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER) From f92d454ac04df1fb80fd3e45e815adbe3464796c Mon Sep 17 00:00:00 2001 From: gum0x Date: Thu, 9 Feb 2017 01:56:20 +0100 Subject: [PATCH 2/2] Ident corrections --- src/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index 7dd497b8c..a7fdea468 100644 --- a/src/Makefile +++ b/src/Makefile @@ -91,6 +91,7 @@ INSTALL := install RM := rm SED := sed SEDOPS := -i + ifeq ($(UNAME),Darwin) CC := clang ifeq ($(OSVERSION),16) @@ -101,8 +102,6 @@ SED := gsed endif endif - - ifeq ($(UNAME),FreeBSD) CC := cc SED := gsed @@ -365,9 +364,9 @@ install_docs: $(FIND) masks/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; $(FIND) rules/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; $(FIND) rules/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \; - $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example0.sh - $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh - $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh + $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example0.sh + $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh + $(SED) $(SEDOPS) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh install_shared: $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)