# 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
## Native compiler paths
##
-CC := gcc
-FIND := find
-INSTALL := install
-RM := rm
-SED := sed
-ifeq ($(UNAME),Darwin)
-SED := gsed
+CC ?= gcc
+FIND ?= find
+INSTALL ?= install
+RM ?= rm
+ifeq ($(UNAME),Darwin,FreeBSD)
+SED ?= gsed
+else
+SED ?= sed
endif
##
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
##