Revert "make native build play well with external build systems"
[hashcat.git] / src / Makefile
index 9f11325..a36bf34 100644 (file)
@@ -17,7 +17,7 @@ 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_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
 
@@ -63,7 +63,7 @@ FIND                     := find
 INSTALL                  := install
 RM                       := rm
 SED                      := sed
-ifeq ($(UNAME),Darwin)
+ifeq ($(UNAME),Darwin,FreeBSD)
 SED                      := gsed
 endif
 
@@ -90,7 +90,7 @@ VERSION_TAG              := $(shell test -d .git && git describe --tags --dirty=
 ## 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
@@ -112,6 +112,7 @@ export MACOSX_DEPLOYMENT_TARGET=10.9
 CFLAGS_NATIVE            := -D_POSIX -DDARWIN
 CFLAGS_NATIVE            += $(CFLAGS)
 LFLAGS_NATIVE            := -lpthread
+LFLAGS_NATIVE            += $(LDFLAGS)
 endif # darwin
 
 ifeq ($(UNAME),Linux)
@@ -122,8 +123,16 @@ endif
 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
 ##