# we need to strip the windows version number to be able to build hashcat on cygwin hosts
UNAME := $(patsubst CYGWIN_NT-%,CYGWIN_NT-,$(UNAME))
-ifeq (,$(filter $(UNAME),Linux Darwin CYGWIN_NT-))
+ifeq (,$(filter $(UNAME),Linux Darwin CYGWIN_NT- FreeBSD))
$(error "! Your Operating System ($(UNAME)) is not supported by $(PROG_NAME) Makefile")
endif
INSTALL := install
RM := rm
SED := sed
+ifeq ($(UNAME),Darwin)
+SED := gsed
+endif
+ifeq ($(UNAME),FreeBSD)
+CC := cc
+SED := gsed
+endif
##
## Cross compiler paths
COMPTIME := $(shell date +%s)
VERSION_EXPORT := $Format:%D$
-VERSION_TAG := $(shell test -d .git && git describe --tags --dirty=+ || echo "$(VERSION_EXPORT)"|cut -d, -f2|sed -r 's|.* (\w+/)?([^ ]+)|\2|')
+VERSION_TAG := $(shell test -d .git && git describe --tags --dirty=+ || echo "$(VERSION_EXPORT)"|cut -d, -f2|$(SED) -r 's|.* (\w+/)?([^ ]+)|\2|')
##
## Compiler flags
##
-CFLAGS := -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ -I$(OPENCL_HEADERS_KHRONOS)/
+CFLAGS += -pipe -W -Wall -std=c99 -Iinclude/ -IOpenCL/ -I$(OPENCL_HEADERS_KHRONOS)/
ifndef DEBUG
CFLAGS += -O2
ifeq ($(UNAME),Darwin)
export MACOSX_DEPLOYMENT_TARGET=10.9
-BINARY_NATIVE := $(BINARY_NATIVE).app
CFLAGS_NATIVE := -D_POSIX -DDARWIN
CFLAGS_NATIVE += $(CFLAGS)
LFLAGS_NATIVE := -lpthread
+LFLAGS_NATIVE += $(LDFLAGS)
endif # darwin
ifeq ($(UNAME),Linux)
CFLAGS_NATIVE += $(CFLAGS)
LFLAGS_NATIVE := -lpthread -ldl
CFLAGS_NATIVE += -DHAVE_HWMON
+LFLAGS_NATIVE += $(LDFLAGS)
endif # linux
+ifeq ($(UNAME),FreeBSD)
+CFLAGS_NATIVE := -D_POSIX
+CFLAGS_NATIVE += $(CFLAGS)
+LFLAGS_NATIVE := -lpthread
+LFLAGS_NATIVE += $(LDFLAGS)
+endif # freebsd
+
##
## Cross compilation target
##
binaries: linux32 linux64 win32 win64
clean:
- $(RM) -f obj/*.o *.bin *.exe *.app *.restore *.out *.pot *.dictstat *.log hashcat core
+ $(RM) -f obj/*.o *.bin *.exe *.restore *.out *.pot *.dictstat *.log hashcat core
$(RM) -rf *.induct
$(RM) -rf *.outfiles
$(RM) -rf *.dSYM