2015-12-04 14:47:52 +00:00
|
|
|
##
|
2016-09-11 20:20:15 +00:00
|
|
|
## Author......: See docs/credits.txt
|
2015-12-04 14:47:52 +00:00
|
|
|
## License.....: MIT
|
|
|
|
##
|
|
|
|
|
2020-06-17 10:32:07 +00:00
|
|
|
SHARED ?= 0
|
2021-07-11 10:38:59 +00:00
|
|
|
DEBUG := 0
|
2021-11-21 16:01:01 +00:00
|
|
|
PRODUCTION := 0
|
2021-11-21 15:39:01 +00:00
|
|
|
PRODUCTION_VERSION := v6.2.5
|
2020-06-17 10:32:07 +00:00
|
|
|
ENABLE_CUBIN ?= 1
|
|
|
|
ENABLE_BRAIN ?= 1
|
2021-05-14 22:04:08 +00:00
|
|
|
ENABLE_UNRAR ?= 1
|
2020-06-17 10:32:07 +00:00
|
|
|
USE_SYSTEM_LZMA ?= 0
|
|
|
|
USE_SYSTEM_ZLIB ?= 0
|
|
|
|
USE_SYSTEM_OPENCL ?= 0
|
|
|
|
USE_SYSTEM_XXHASH ?= 0
|
2020-09-08 08:51:15 +00:00
|
|
|
## do not change, requires some hacks
|
|
|
|
USE_SYSTEM_UNRAR ?= 0
|
2017-01-31 10:44:58 +00:00
|
|
|
|
2016-01-20 19:55:09 +00:00
|
|
|
##
|
|
|
|
## Detect Operating System
|
|
|
|
##
|
|
|
|
|
2016-10-30 12:54:24 +00:00
|
|
|
UNAME := $(shell uname -s)
|
2016-06-11 06:08:22 +00:00
|
|
|
|
|
|
|
# we need to strip the windows version number to be able to build hashcat on cygwin hosts
|
2016-10-30 12:54:24 +00:00
|
|
|
UNAME := $(patsubst CYGWIN_NT-%,CYGWIN,$(UNAME))
|
2016-01-20 19:55:09 +00:00
|
|
|
|
2016-10-30 12:54:24 +00:00
|
|
|
# same for msys
|
|
|
|
UNAME := $(patsubst MSYS_NT-%,MSYS2,$(UNAME))
|
|
|
|
UNAME := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME))
|
|
|
|
UNAME := $(patsubst MINGW64_NT-%,MSYS2,$(UNAME))
|
|
|
|
|
|
|
|
ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin CYGWIN MSYS2))
|
2016-12-29 19:40:07 +00:00
|
|
|
$(error "! Your Operating System ($(UNAME)) is not supported by this Makefile")
|
2016-01-20 19:55:09 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
$(warning "## Detected Operating System : $(UNAME)")
|
|
|
|
endif
|
|
|
|
|
2015-12-04 14:47:52 +00:00
|
|
|
##
|
|
|
|
## Makefile flags
|
|
|
|
##
|
|
|
|
|
2019-02-15 08:24:30 +00:00
|
|
|
MAKEFLAGS += -l -j 8 -rR --no-print-directory
|
2015-12-04 14:47:52 +00:00
|
|
|
|
|
|
|
ifneq ($(findstring clean,$(MAKECMDGOALS)),)
|
2016-10-30 12:54:24 +00:00
|
|
|
MAKEFLAGS += -j 1
|
2015-12-04 14:47:52 +00:00
|
|
|
endif
|
|
|
|
|
2019-01-11 23:39:13 +00:00
|
|
|
##
|
|
|
|
## Do not modify
|
|
|
|
##
|
|
|
|
|
2021-08-01 14:25:37 +00:00
|
|
|
MODULE_INTERFACE_VERSION := 630
|
2019-01-11 23:39:13 +00:00
|
|
|
|
2018-01-26 19:04:32 +00:00
|
|
|
##
|
|
|
|
## Native compiler paths
|
|
|
|
##
|
|
|
|
|
2018-10-20 09:52:27 +00:00
|
|
|
CC := gcc
|
2020-09-08 08:51:15 +00:00
|
|
|
CXX := g++
|
2019-04-03 13:37:29 +00:00
|
|
|
AR := ar
|
2018-01-26 19:04:32 +00:00
|
|
|
FIND := find
|
|
|
|
INSTALL := install
|
|
|
|
RM := rm
|
|
|
|
SED := sed
|
|
|
|
SED_IN_PLACE := -i
|
|
|
|
|
|
|
|
ifeq ($(UNAME),Darwin)
|
|
|
|
CC := clang
|
2020-09-08 08:51:15 +00:00
|
|
|
CXX := clang++
|
2018-01-26 19:04:32 +00:00
|
|
|
# the sed -i option of macOS requires a parameter for the backup file (we just use "")
|
2019-06-21 19:15:59 +00:00
|
|
|
AR := /usr/bin/ar
|
2018-02-28 15:42:04 +00:00
|
|
|
SED := /usr/bin/sed
|
2018-01-26 19:04:32 +00:00
|
|
|
SED_IN_PLACE := -i ""
|
2021-01-08 00:03:59 +00:00
|
|
|
DARWIN_VERSION := $(shell uname -r | cut -d. -f1)
|
2018-01-26 19:04:32 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(UNAME),FreeBSD)
|
|
|
|
CC := cc
|
2020-09-08 08:51:15 +00:00
|
|
|
CXX := c++
|
2018-01-26 19:04:32 +00:00
|
|
|
SED := gsed
|
|
|
|
endif
|
|
|
|
|
2018-01-26 22:15:11 +00:00
|
|
|
##
|
|
|
|
## Version
|
|
|
|
##
|
|
|
|
|
|
|
|
ifeq ($(PRODUCTION),1)
|
|
|
|
VERSION_TAG := $(PRODUCTION_VERSION)
|
|
|
|
else
|
|
|
|
VERSION_TAG := $(shell git describe --tags --dirty=+ || echo $(PRODUCTION_VERSION))
|
|
|
|
endif # PRODUCTION
|
2018-01-26 19:04:32 +00:00
|
|
|
|
|
|
|
VERSION_PURE := $(shell echo "$(VERSION_TAG)" | $(SED) 's/.*v\([\.0-9]*\).*/\1/')
|
|
|
|
|
2015-12-04 14:47:52 +00:00
|
|
|
##
|
2018-11-08 11:52:06 +00:00
|
|
|
## Installation paths
|
2015-12-13 11:21:36 +00:00
|
|
|
##
|
|
|
|
|
2016-10-30 12:54:24 +00:00
|
|
|
DESTDIR ?=
|
|
|
|
PREFIX ?= /usr/local
|
2015-12-13 11:21:36 +00:00
|
|
|
|
2016-10-30 12:54:24 +00:00
|
|
|
INSTALL_FOLDER ?= $(PREFIX)/bin
|
2017-11-06 11:46:56 +00:00
|
|
|
SHARED_ROOT_FOLDER ?= $(PREFIX)/share
|
|
|
|
SHARED_FOLDER ?= $(SHARED_ROOT_FOLDER)/hashcat
|
|
|
|
DOCUMENT_FOLDER ?= $(SHARED_ROOT_FOLDER)/doc/hashcat
|
2018-01-26 19:04:32 +00:00
|
|
|
LIBRARY_FOLDER ?= $(PREFIX)/lib
|
|
|
|
LIBRARY_DEV_ROOT_FOLDER ?= $(PREFIX)/include
|
|
|
|
LIBRARY_DEV_FOLDER ?= $(LIBRARY_DEV_ROOT_FOLDER)/hashcat
|
2016-12-29 19:40:07 +00:00
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
##
|
2020-08-12 08:45:35 +00:00
|
|
|
## Dependencies paths
|
2018-11-08 11:52:06 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
ifeq ($(USE_SYSTEM_LZMA),0)
|
|
|
|
DEPS_LZMA_PATH := deps/LZMA-SDK/C
|
|
|
|
else
|
2020-02-24 02:17:48 +00:00
|
|
|
DEPS_LZMA_PATH := $(LIBRARY_DEV_ROOT_FOLDER)
|
2018-11-08 11:52:06 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-07 13:31:11 +00:00
|
|
|
ifeq ($(USE_SYSTEM_ZLIB),0)
|
2020-02-24 02:17:48 +00:00
|
|
|
DEPS_ZLIB_PATH := deps/zlib
|
2019-05-07 13:31:11 +00:00
|
|
|
else
|
2020-02-24 02:17:48 +00:00
|
|
|
DEPS_ZLIB_PATH := $(LIBRARY_DEV_ROOT_FOLDER)
|
2019-05-07 13:31:11 +00:00
|
|
|
endif
|
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
ifeq ($(USE_SYSTEM_OPENCL),0)
|
|
|
|
DEPS_OPENCL_PATH := deps/OpenCL-Headers
|
|
|
|
else
|
2020-02-24 02:17:48 +00:00
|
|
|
DEPS_OPENCL_PATH := $(LIBRARY_DEV_ROOT_FOLDER)
|
2018-11-08 11:52:06 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USE_SYSTEM_XXHASH),0)
|
|
|
|
DEPS_XXHASH_PATH := deps/xxHash
|
|
|
|
else
|
2020-02-24 02:17:48 +00:00
|
|
|
DEPS_XXHASH_PATH := $(LIBRARY_DEV_ROOT_FOLDER)
|
2018-11-08 11:52:06 +00:00
|
|
|
endif
|
|
|
|
|
2021-05-14 22:04:08 +00:00
|
|
|
ifeq ($(ENABLE_UNRAR),1)
|
2020-09-08 08:51:15 +00:00
|
|
|
ifeq ($(USE_SYSTEM_UNRAR),0)
|
|
|
|
DEPS_UNRAR_PATH := deps/unrar
|
|
|
|
else
|
|
|
|
DEPS_UNRAR_PATH := $(LIBRARY_DEV_ROOT_FOLDER)
|
|
|
|
endif
|
2021-05-14 22:04:08 +00:00
|
|
|
endif
|
2020-09-08 08:51:15 +00:00
|
|
|
|
2016-12-29 19:40:07 +00:00
|
|
|
##
|
|
|
|
## Filenames for library and frontend
|
|
|
|
##
|
|
|
|
|
|
|
|
HASHCAT_FRONTEND := hashcat
|
2018-01-26 19:04:32 +00:00
|
|
|
HASHCAT_LIBRARY := libhashcat.so.$(VERSION_PURE)
|
2016-12-29 19:40:07 +00:00
|
|
|
|
2018-07-23 21:09:37 +00:00
|
|
|
ifeq ($(UNAME),Darwin)
|
|
|
|
HASHCAT_LIBRARY := libhashcat.$(VERSION_PURE).dylib
|
|
|
|
endif # Darwin
|
|
|
|
|
2016-12-29 19:40:07 +00:00
|
|
|
ifeq ($(UNAME),CYGWIN)
|
|
|
|
HASHCAT_FRONTEND := hashcat.exe
|
|
|
|
HASHCAT_LIBRARY := hashcat.dll
|
|
|
|
endif # CYGWIN
|
|
|
|
|
|
|
|
ifeq ($(UNAME),MSYS2)
|
|
|
|
HASHCAT_FRONTEND := hashcat.exe
|
|
|
|
HASHCAT_LIBRARY := hashcat.dll
|
|
|
|
endif # MSYS2
|
2015-12-13 11:21:36 +00:00
|
|
|
|
2018-01-26 19:04:32 +00:00
|
|
|
##
|
|
|
|
## Misc stuff
|
|
|
|
##
|
|
|
|
|
|
|
|
COMPTIME := $(shell date +%s)
|
|
|
|
|
2015-12-04 14:47:52 +00:00
|
|
|
##
|
2016-10-30 21:47:48 +00:00
|
|
|
## General compiler and linker options
|
2015-12-04 14:47:52 +00:00
|
|
|
##
|
|
|
|
|
2018-10-20 15:35:54 +00:00
|
|
|
LFLAGS := $(LDFLAGS)
|
2017-01-04 09:33:20 +00:00
|
|
|
|
|
|
|
ifeq ($(PRODUCTION),0)
|
2016-10-30 19:37:02 +00:00
|
|
|
CFLAGS += -W
|
|
|
|
CFLAGS += -Wall
|
|
|
|
CFLAGS += -Wextra
|
2019-01-18 07:34:36 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
## because LZMA SDK
|
|
|
|
ifeq ($(CC),clang)
|
|
|
|
CFLAGS += -Wno-enum-conversion
|
2021-06-06 12:32:14 +00:00
|
|
|
CFLAGS += -Wno-typedef-redefinition
|
2018-02-22 18:47:40 +00:00
|
|
|
endif
|
|
|
|
|
2021-08-25 15:23:49 +00:00
|
|
|
ifeq ($(USE_SYSTEM_LZMA),0)
|
|
|
|
CFLAGS_LZMA += -D_7ZIP_ST
|
2021-08-26 10:46:37 +00:00
|
|
|
CFLAGS_LZMA += -Wno-misleading-indentation
|
2021-08-25 15:23:49 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-07 13:31:11 +00:00
|
|
|
## because ZLIB
|
|
|
|
ifeq ($(USE_SYSTEM_ZLIB),0)
|
|
|
|
CFLAGS_ZLIB += -Wno-implicit-fallthrough
|
2019-06-29 13:13:07 +00:00
|
|
|
CFLAGS_ZLIB += -Wno-implicit-function-declaration
|
2019-07-29 16:42:50 +00:00
|
|
|
CFLAGS_ZLIB += -Wno-unused-parameter
|
|
|
|
CFLAGS_ZLIB += -DIOAPI_NO_64
|
2021-09-04 14:08:52 +00:00
|
|
|
CFLAGS_ZLIB += -DUNZ_BUFSIZE=262144
|
2019-05-07 13:31:11 +00:00
|
|
|
endif
|
|
|
|
|
2020-09-08 08:51:15 +00:00
|
|
|
## because UNRAR
|
2021-05-14 22:04:08 +00:00
|
|
|
ifeq ($(ENABLE_UNRAR),1)
|
2020-09-08 08:51:15 +00:00
|
|
|
ifeq ($(USE_SYSTEM_UNRAR),0)
|
2021-08-01 14:25:37 +00:00
|
|
|
ifneq ($(CC),clang)
|
2020-12-16 21:26:59 +00:00
|
|
|
CFLAGS_UNRAR += -Wno-class-memaccess
|
2021-08-01 14:25:37 +00:00
|
|
|
CFLAGS_UNRAR += -Wno-misleading-indentation
|
2020-12-16 21:26:59 +00:00
|
|
|
endif
|
2021-08-01 14:25:37 +00:00
|
|
|
CFLAGS_UNRAR += -Wno-missing-braces
|
2020-09-08 08:51:15 +00:00
|
|
|
CFLAGS_UNRAR += -Wno-unused-variable
|
|
|
|
CFLAGS_UNRAR += -Wno-unused-parameter
|
|
|
|
CFLAGS_UNRAR += -Wno-unused-function
|
|
|
|
CFLAGS_UNRAR += -Wno-sign-compare
|
|
|
|
CFLAGS_UNRAR += -Wno-dangling-else
|
|
|
|
CFLAGS_UNRAR += -Wno-switch
|
|
|
|
CFLAGS_UNRAR += -Wno-parentheses
|
|
|
|
CFLAGS_UNRAR += -Wno-implicit-fallthrough
|
|
|
|
CFLAGS_UNRAR += -Wno-extra
|
|
|
|
CFLAGS_UNRAR += -Wno-unknown-pragmas
|
|
|
|
endif
|
2021-05-14 22:04:08 +00:00
|
|
|
endif
|
2020-09-08 08:51:15 +00:00
|
|
|
|
2017-01-31 10:44:58 +00:00
|
|
|
ifeq ($(DEBUG),0)
|
2016-10-30 12:54:24 +00:00
|
|
|
CFLAGS += -O2
|
2018-02-28 15:42:04 +00:00
|
|
|
ifneq ($(UNAME),Darwin)
|
2016-10-30 12:54:24 +00:00
|
|
|
LFLAGS += -s
|
2018-02-28 15:42:04 +00:00
|
|
|
endif
|
2017-02-11 13:18:42 +00:00
|
|
|
else
|
2017-01-31 10:44:58 +00:00
|
|
|
ifeq ($(DEBUG),1)
|
2019-01-08 15:32:27 +00:00
|
|
|
ifneq ($(UNAME),Darwin)
|
2017-10-27 07:08:56 +00:00
|
|
|
CFLAGS += -DDEBUG -Og -ggdb
|
2017-02-11 13:18:42 +00:00
|
|
|
else
|
2019-01-08 15:32:27 +00:00
|
|
|
CFLAGS += -DDEBUG -O0 -ggdb
|
|
|
|
endif
|
|
|
|
else
|
2016-03-06 11:03:08 +00:00
|
|
|
ifeq ($(DEBUG),2)
|
2019-01-08 15:32:27 +00:00
|
|
|
ifneq ($(UNAME),Darwin)
|
2017-10-27 07:08:56 +00:00
|
|
|
CFLAGS += -DDEBUG -Og -ggdb
|
2019-01-08 15:32:27 +00:00
|
|
|
else
|
|
|
|
CFLAGS += -DDEBUG -O0 -ggdb
|
|
|
|
endif
|
2016-10-30 12:54:24 +00:00
|
|
|
CFLAGS += -fsanitize=address -fno-omit-frame-pointer
|
2016-01-20 19:55:09 +00:00
|
|
|
endif
|
2016-10-10 09:27:50 +00:00
|
|
|
endif
|
2017-01-31 10:44:58 +00:00
|
|
|
endif
|
2016-10-10 09:27:50 +00:00
|
|
|
|
2020-09-08 08:51:15 +00:00
|
|
|
CFLAGS += -pipe -Iinclude/ -IOpenCL/
|
2018-10-20 15:35:54 +00:00
|
|
|
|
|
|
|
# LZMA
|
2018-11-08 11:52:06 +00:00
|
|
|
CFLAGS += -I$(DEPS_LZMA_PATH)
|
|
|
|
ifeq ($(USE_SYSTEM_LZMA),1)
|
|
|
|
LFLAGS += -llzmasdk
|
2018-10-20 15:35:54 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-07 13:31:11 +00:00
|
|
|
# ZLIB
|
2020-07-21 10:41:20 +00:00
|
|
|
CFLAGS += -I$(DEPS_ZLIB_PATH) -I$(DEPS_ZLIB_PATH)/contrib
|
2019-05-07 13:31:11 +00:00
|
|
|
ifeq ($(USE_SYSTEM_ZLIB),1)
|
2020-06-17 14:06:25 +00:00
|
|
|
LFLAGS += -lz -lminizip
|
2019-05-07 13:31:11 +00:00
|
|
|
endif
|
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
# OpenCL
|
|
|
|
CFLAGS += -I$(DEPS_OPENCL_PATH)
|
|
|
|
|
2018-10-28 15:47:13 +00:00
|
|
|
# brain and xxHash
|
|
|
|
ifeq ($(ENABLE_BRAIN),1)
|
|
|
|
CFLAGS += -DWITH_BRAIN
|
2018-11-08 11:52:06 +00:00
|
|
|
CFLAGS += -I$(DEPS_XXHASH_PATH)
|
|
|
|
ifeq ($(USE_SYSTEM_XXHASH),1)
|
|
|
|
LFLAGS += -lxxhash
|
|
|
|
endif
|
2018-10-28 15:47:13 +00:00
|
|
|
endif
|
|
|
|
|
2020-01-31 16:50:53 +00:00
|
|
|
# CUDA binary cache
|
|
|
|
ifeq ($(ENABLE_CUBIN),1)
|
|
|
|
CFLAGS += -DWITH_CUBIN
|
|
|
|
endif
|
|
|
|
|
2020-09-08 08:51:15 +00:00
|
|
|
# unrar
|
2021-05-14 22:04:08 +00:00
|
|
|
ifeq ($(ENABLE_UNRAR),1)
|
2020-09-08 08:51:15 +00:00
|
|
|
CFLAGS += -I$(DEPS_UNRAR_PATH)
|
|
|
|
LFLAGS += -lstdc++
|
2021-05-14 22:04:08 +00:00
|
|
|
endif
|
2020-09-08 08:51:15 +00:00
|
|
|
|
2016-01-03 17:50:02 +00:00
|
|
|
##
|
|
|
|
## Native compilation target
|
|
|
|
##
|
|
|
|
|
2016-01-20 19:55:09 +00:00
|
|
|
ifeq ($(UNAME),Linux)
|
2016-10-30 12:54:24 +00:00
|
|
|
CFLAGS_NATIVE := $(CFLAGS)
|
|
|
|
CFLAGS_NATIVE += -DWITH_HWMON
|
|
|
|
LFLAGS_NATIVE := $(LFLAGS)
|
2017-04-14 14:36:28 +00:00
|
|
|
LFLAGS_NATIVE += -lpthread
|
2017-04-19 08:51:28 +00:00
|
|
|
LFLAGS_NATIVE += -ldl
|
2018-01-26 22:24:01 +00:00
|
|
|
LFLAGS_NATIVE += -lrt
|
2018-07-31 14:18:45 +00:00
|
|
|
LFLAGS_NATIVE += -lm
|
2016-10-30 12:54:24 +00:00
|
|
|
endif # Linux
|
2016-01-03 17:50:02 +00:00
|
|
|
|
2016-07-05 18:58:28 +00:00
|
|
|
ifeq ($(UNAME),FreeBSD)
|
2016-12-30 13:19:00 +00:00
|
|
|
ifndef PORTNAME
|
2016-10-30 12:54:24 +00:00
|
|
|
CFLAGS_NATIVE := $(CFLAGS)
|
2016-12-30 13:41:15 +00:00
|
|
|
LFLAGS_NATIVE := $(LFLAGS)
|
2017-04-19 08:51:28 +00:00
|
|
|
LFLAGS_NATIVE += -lpthread
|
2018-07-31 14:18:45 +00:00
|
|
|
LFLAGS_NATIVE += -lm
|
2020-06-15 12:55:12 +00:00
|
|
|
LFLAGS_NATIVE += -liconv
|
2016-12-30 13:41:15 +00:00
|
|
|
endif
|
2016-10-30 12:54:24 +00:00
|
|
|
endif # FreeBSD
|
2016-10-13 15:27:09 +00:00
|
|
|
|
2016-10-30 12:54:24 +00:00
|
|
|
ifeq ($(UNAME),Darwin)
|
|
|
|
export MACOSX_DEPLOYMENT_TARGET=10.9
|
|
|
|
CFLAGS_NATIVE := $(CFLAGS)
|
2021-06-12 18:13:31 +00:00
|
|
|
CFLAGS_NATIVE += -DWITH_HWMON
|
2017-12-26 13:09:30 +00:00
|
|
|
|
2021-01-08 00:03:59 +00:00
|
|
|
ifeq ($(shell test $(DARWIN_VERSION) -le 15; echo $$?), 0)
|
2017-12-26 13:09:30 +00:00
|
|
|
CFLAGS_NATIVE += -DMISSING_CLOCK_GETTIME
|
|
|
|
endif
|
|
|
|
|
2016-10-30 12:54:24 +00:00
|
|
|
LFLAGS_NATIVE := $(LFLAGS)
|
2016-10-30 13:31:17 +00:00
|
|
|
LFLAGS_NATIVE += -framework OpenCL
|
2021-06-12 18:13:31 +00:00
|
|
|
LFLAGS_NATIVE += -framework IOKit
|
2016-10-30 12:54:24 +00:00
|
|
|
LFLAGS_NATIVE += -lpthread
|
2017-04-14 16:54:34 +00:00
|
|
|
LFLAGS_NATIVE += -liconv
|
2016-10-30 12:54:24 +00:00
|
|
|
endif # Darwin
|
|
|
|
|
|
|
|
ifeq ($(UNAME),CYGWIN)
|
|
|
|
CFLAGS_NATIVE := $(CFLAGS)
|
|
|
|
CFLAGS_NATIVE += -DWITH_HWMON
|
|
|
|
LFLAGS_NATIVE := $(LFLAGS)
|
2019-01-13 18:34:01 +00:00
|
|
|
LFLAGS_NATIVE += -Wl,--dynamicbase
|
|
|
|
LFLAGS_NATIVE += -Wl,--nxcompat
|
2016-10-30 12:54:24 +00:00
|
|
|
LFLAGS_NATIVE += -lpsapi
|
2017-04-14 14:36:28 +00:00
|
|
|
LFLAGS_NATIVE += -liconv
|
2016-10-30 12:54:24 +00:00
|
|
|
endif # CYGWIN
|
|
|
|
|
|
|
|
ifeq ($(UNAME),MSYS2)
|
|
|
|
CFLAGS_NATIVE := $(CFLAGS)
|
|
|
|
CFLAGS_NATIVE += -DWITH_HWMON
|
|
|
|
LFLAGS_NATIVE := $(LFLAGS)
|
2019-01-13 18:34:01 +00:00
|
|
|
LFLAGS_NATIVE += -Wl,--dynamicbase
|
|
|
|
LFLAGS_NATIVE += -Wl,--nxcompat
|
2016-10-30 12:54:24 +00:00
|
|
|
LFLAGS_NATIVE += -lpsapi
|
2017-04-14 14:36:28 +00:00
|
|
|
LFLAGS_NATIVE += -liconv
|
2018-09-01 12:09:24 +00:00
|
|
|
LFLAGS_NATIVE += -lws2_32
|
2020-09-08 08:51:15 +00:00
|
|
|
LFLAGS_NATIVE += -lpowrprof
|
2016-10-30 12:54:24 +00:00
|
|
|
endif # MSYS2
|
|
|
|
|
2020-09-08 08:51:15 +00:00
|
|
|
# CCFLAGS only for C compiler
|
|
|
|
CCFLAGS := -std=gnu99
|
|
|
|
|
|
|
|
# CXXFLAGS only for C++ compiler
|
|
|
|
CXXFLAGS :=
|
|
|
|
|
2016-01-20 19:55:09 +00:00
|
|
|
##
|
|
|
|
## Objects
|
|
|
|
##
|
|
|
|
|
2019-04-25 12:45:17 +00:00
|
|
|
EMU_OBJS_ALL := emu_general emu_inc_common emu_inc_platform emu_inc_scalar emu_inc_simd
|
2019-04-03 13:37:29 +00:00
|
|
|
EMU_OBJS_ALL += emu_inc_rp emu_inc_rp_optimized
|
2019-12-05 09:43:42 +00:00
|
|
|
EMU_OBJS_ALL += emu_inc_hash_md4 emu_inc_hash_md5 emu_inc_hash_ripemd160 emu_inc_hash_sha1 emu_inc_hash_sha256 emu_inc_hash_sha384 emu_inc_hash_sha512 emu_inc_hash_streebog256 emu_inc_hash_streebog512 emu_inc_ecc_secp256k1
|
2019-03-25 11:24:04 +00:00
|
|
|
EMU_OBJS_ALL += emu_inc_cipher_aes emu_inc_cipher_camellia emu_inc_cipher_des emu_inc_cipher_kuznyechik emu_inc_cipher_serpent emu_inc_cipher_twofish
|
|
|
|
|
2021-07-10 19:34:09 +00:00
|
|
|
OBJS_ALL := affinity autotune backend benchmark bitmap bitops combinator common convert cpt cpu_crc32 debugfile dictstat dispatch dynloader event ext_ADL ext_cuda ext_hip ext_nvapi ext_nvml ext_nvrtc ext_hiprtc ext_OpenCL ext_sysfs_amdgpu ext_sysfs_cpu ext_iokit ext_lzma filehandling folder hashcat hashes hlfmt hwmon induct interface keyboard_layout locking logfile loopback memory monitor mpsp outfile_check outfile pidfile potfile restore rp rp_cpu selftest slow_candidates shared status stdout straight terminal thread timer tuningdb usage user_options wordlist $(EMU_OBJS_ALL)
|
2018-02-22 18:47:40 +00:00
|
|
|
|
2018-10-28 15:47:13 +00:00
|
|
|
ifeq ($(ENABLE_BRAIN),1)
|
|
|
|
OBJS_ALL += brain
|
|
|
|
endif
|
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
NATIVE_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.o)
|
2019-02-22 20:36:02 +00:00
|
|
|
LINUX_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).LINUX.o)
|
|
|
|
WIN_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).WIN.o)
|
2016-06-07 10:39:41 +00:00
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
ifeq ($(USE_SYSTEM_LZMA),0)
|
2021-08-26 13:41:17 +00:00
|
|
|
OBJS_LZMA := 7zCrc 7zCrcOpt 7zFile 7zStream Alloc Bra Bra86 BraIA64 CpuArch Delta LzmaDec Lzma2Dec Sha256 Sha256Opt Xz XzCrc64 XzCrc64Opt XzDec XzIn
|
2018-11-08 11:52:06 +00:00
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
NATIVE_OBJS += $(foreach OBJ,$(OBJS_LZMA),obj/$(OBJ).LZMA.NATIVE.o)
|
|
|
|
LINUX_OBJS += $(foreach OBJ,$(OBJS_LZMA),obj/$(OBJ).LZMA.LINUX.o)
|
|
|
|
WIN_OBJS += $(foreach OBJ,$(OBJS_LZMA),obj/$(OBJ).LZMA.WIN.o)
|
2018-11-08 11:52:06 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-07 13:31:11 +00:00
|
|
|
ifeq ($(USE_SYSTEM_ZLIB),0)
|
2019-07-29 16:42:50 +00:00
|
|
|
OBJS_ZLIB := adler32 crc32 deflate inflate inffast inftrees trees gzread gzwrite gzclose zutil gzlib contrib/minizip/unzip contrib/minizip/ioapi
|
2019-05-07 13:31:11 +00:00
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
NATIVE_OBJS += $(foreach OBJ,$(OBJS_ZLIB),obj/$(OBJ).ZLIB.NATIVE.o)
|
|
|
|
LINUX_OBJS += $(foreach OBJ,$(OBJS_ZLIB),obj/$(OBJ).ZLIB.LINUX.o)
|
|
|
|
WIN_OBJS += $(foreach OBJ,$(OBJS_ZLIB),obj/$(OBJ).ZLIB.WIN.o)
|
2019-05-07 13:31:11 +00:00
|
|
|
endif
|
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
ifeq ($(USE_SYSTEM_XXHASH),0)
|
2018-10-28 15:47:13 +00:00
|
|
|
ifeq ($(ENABLE_BRAIN),1)
|
|
|
|
OBJS_XXHASH := xxhash
|
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
NATIVE_OBJS += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).XXHASH.NATIVE.o)
|
|
|
|
LINUX_OBJS += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).XXHASH.LINUX.o)
|
|
|
|
WIN_OBJS += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).XXHASH.WIN.o)
|
2018-10-28 15:47:13 +00:00
|
|
|
endif
|
2018-07-23 11:36:23 +00:00
|
|
|
endif
|
|
|
|
|
2021-05-14 22:04:08 +00:00
|
|
|
ifeq ($(ENABLE_UNRAR),1)
|
2020-09-08 08:51:15 +00:00
|
|
|
ifeq ($(USE_SYSTEM_UNRAR),0)
|
|
|
|
OBJS_UNRAR := strlist strfn pathfn smallfn global file filefn filcreat archive arcread unicode system isnt crypt crc rawread encname resource match timefn rdwrfn consio options errhnd rarvm secpassword rijndael getbits sha1 sha256 blake2s hash extinfo extract volume list find unpack headers threadpool rs16 cmddata ui filestr recvol rs scantree qopen hc_decompress_rar
|
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
NATIVE_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).UNRAR.NATIVE.o)
|
|
|
|
LINUX_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).UNRAR.LINUX.o)
|
|
|
|
WIN_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).UNRAR.WIN.o)
|
2020-09-08 08:51:15 +00:00
|
|
|
endif
|
2021-05-14 22:04:08 +00:00
|
|
|
endif
|
2020-09-08 08:51:15 +00:00
|
|
|
|
2015-12-04 14:47:52 +00:00
|
|
|
##
|
2016-12-29 19:40:07 +00:00
|
|
|
## Targets: Native Compilation
|
2015-12-04 14:47:52 +00:00
|
|
|
##
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: default
|
2019-01-20 16:18:22 +00:00
|
|
|
default: $(HASHCAT_FRONTEND) modules
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: clean
|
2016-01-02 16:42:47 +00:00
|
|
|
clean:
|
2018-01-26 19:04:32 +00:00
|
|
|
$(RM) -f $(HASHCAT_FRONTEND)
|
|
|
|
$(RM) -f $(HASHCAT_LIBRARY)
|
2020-07-08 10:48:29 +00:00
|
|
|
$(RM) -rf modules/*.dSYM
|
2018-12-21 08:48:51 +00:00
|
|
|
$(RM) -f modules/*.dll
|
2018-12-14 11:22:13 +00:00
|
|
|
$(RM) -f modules/*.so
|
2019-07-29 16:42:50 +00:00
|
|
|
$(RM) -f obj/*/*/*.o
|
2020-09-08 08:51:15 +00:00
|
|
|
$(RM) -f obj/*/*.o
|
2018-01-26 19:04:32 +00:00
|
|
|
$(RM) -f obj/*.o
|
2019-01-20 17:24:54 +00:00
|
|
|
$(RM) -f obj/*.a
|
2020-07-08 10:48:29 +00:00
|
|
|
$(RM) -rf *.dSYM
|
2020-06-27 10:37:48 +00:00
|
|
|
$(RM) -f *.dylib
|
2018-01-26 19:04:32 +00:00
|
|
|
$(RM) -f *.bin *.exe
|
|
|
|
$(RM) -f *.pid
|
|
|
|
$(RM) -f *.log
|
|
|
|
$(RM) -f core
|
2016-01-02 23:40:31 +00:00
|
|
|
$(RM) -rf *.induct
|
|
|
|
$(RM) -rf *.outfiles
|
2016-01-13 17:16:56 +00:00
|
|
|
$(RM) -rf kernels
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: distclean
|
2017-04-06 09:39:29 +00:00
|
|
|
distclean: clean
|
2020-06-27 10:37:48 +00:00
|
|
|
$(RM) -f *.restore
|
|
|
|
$(RM) -f *.potfile
|
|
|
|
$(RM) -f *.out
|
2020-07-01 08:45:38 +00:00
|
|
|
$(RM) -f hashcat.dictstat2
|
|
|
|
$(RM) -f brain.*
|
|
|
|
$(RM) -rf test_[0-9]*
|
|
|
|
$(RM) -rf tools/luks_tests
|
2017-04-06 09:39:29 +00:00
|
|
|
|
2015-12-13 11:21:36 +00:00
|
|
|
##
|
|
|
|
## Targets: Linux install
|
|
|
|
##
|
|
|
|
|
2018-01-26 07:20:12 +00:00
|
|
|
# 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
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install
|
2017-01-27 13:59:05 +00:00
|
|
|
ifeq ($(SHARED),1)
|
2019-01-20 11:26:33 +00:00
|
|
|
install: install_docs install_shared install_library install_library_dev install_kernels install_modules install_hashcat
|
2017-01-27 13:59:05 +00:00
|
|
|
else
|
2019-01-20 11:26:33 +00:00
|
|
|
install: install_docs install_shared install_kernels install_modules install_hashcat
|
2017-01-27 13:59:05 +00:00
|
|
|
endif
|
2016-12-29 19:40:07 +00:00
|
|
|
|
2017-11-06 11:46:56 +00:00
|
|
|
# we need this extra target to make sure that for parallel builds (i.e. 2+ Makefile targets could possible run at the same time)
|
|
|
|
# the root folder of the shared directory is created first (and is a dependency for the targets that depend on it)
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_make_library_dev_root
|
2018-01-26 19:04:32 +00:00
|
|
|
install_make_library_dev_root:
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_DEV_ROOT_FOLDER)
|
2018-01-18 11:09:51 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_make_shared_root
|
2018-01-26 19:04:32 +00:00
|
|
|
install_make_shared_root:
|
2018-01-26 15:29:03 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_ROOT_FOLDER)
|
2017-11-06 11:46:56 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_docs
|
2018-01-26 19:04:32 +00:00
|
|
|
install_docs: install_make_shared_root
|
2018-01-26 15:29:03 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/charsets
|
2018-11-15 13:35:51 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/docs
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/layouts
|
2018-01-26 15:29:03 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/masks
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/rules
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/extra
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion
|
|
|
|
$(INSTALL) -m 644 example.dict $(DESTDIR)$(DOCUMENT_FOLDER)/
|
|
|
|
$(INSTALL) -m 644 example0.hash $(DESTDIR)$(DOCUMENT_FOLDER)/
|
|
|
|
$(INSTALL) -m 644 example400.hash $(DESTDIR)$(DOCUMENT_FOLDER)/
|
|
|
|
$(INSTALL) -m 644 example500.hash $(DESTDIR)$(DOCUMENT_FOLDER)/
|
|
|
|
$(INSTALL) -m 755 example0.sh $(DESTDIR)$(DOCUMENT_FOLDER)/
|
|
|
|
$(INSTALL) -m 755 example400.sh $(DESTDIR)$(DOCUMENT_FOLDER)/
|
|
|
|
$(INSTALL) -m 755 example500.sh $(DESTDIR)$(DOCUMENT_FOLDER)/
|
|
|
|
$(INSTALL) -m 644 extra/tab_completion/hashcat.sh $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/
|
|
|
|
$(INSTALL) -m 644 extra/tab_completion/howto.txt $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/
|
|
|
|
$(INSTALL) -m 755 extra/tab_completion/install $(DESTDIR)$(DOCUMENT_FOLDER)/extra/tab_completion/
|
|
|
|
$(FIND) charsets/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
|
|
|
|
$(FIND) charsets/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
|
2018-11-15 13:35:51 +00:00
|
|
|
$(FIND) docs/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
|
|
|
|
$(FIND) docs/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
|
|
|
|
$(FIND) layouts/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
|
|
|
|
$(FIND) layouts/ -type f -exec $(INSTALL) -m 644 {} $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
|
2018-01-26 15:29:03 +00:00
|
|
|
$(FIND) masks/ -type d -exec $(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/{} \;
|
|
|
|
$(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) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example0.sh
|
|
|
|
$(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh
|
|
|
|
$(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh
|
2015-12-13 11:21:36 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_shared
|
2018-01-26 19:04:32 +00:00
|
|
|
install_shared: install_make_shared_root
|
2018-01-26 15:29:03 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)
|
|
|
|
$(INSTALL) -m 644 hashcat.hctune $(DESTDIR)$(SHARED_FOLDER)/
|
|
|
|
$(INSTALL) -m 644 hashcat.hcstat2 $(DESTDIR)$(SHARED_FOLDER)/
|
2019-01-20 11:26:33 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_kernels
|
2019-01-20 11:26:33 +00:00
|
|
|
install_kernels: install_shared
|
2018-01-26 15:29:03 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/OpenCL
|
2018-01-26 19:04:32 +00:00
|
|
|
$(FIND) OpenCL/ -mindepth 1 -type d -execdir $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/OpenCL/{} \;
|
|
|
|
$(FIND) OpenCL/ -mindepth 1 -type f -execdir $(INSTALL) -m 644 {} $(DESTDIR)$(SHARED_FOLDER)/OpenCL/{} \;
|
2015-12-13 11:21:36 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_modules
|
2019-01-20 11:26:33 +00:00
|
|
|
install_modules: install_shared modules
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/modules
|
|
|
|
$(FIND) modules/ -mindepth 1 -type d -execdir $(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/modules/{} \;
|
|
|
|
$(FIND) modules/ -mindepth 1 -type f -execdir $(INSTALL) -m 644 {} $(DESTDIR)$(SHARED_FOLDER)/modules/{} \;
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_library
|
2016-12-29 19:40:07 +00:00
|
|
|
install_library: $(HASHCAT_LIBRARY)
|
2018-01-26 15:29:03 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_FOLDER)
|
|
|
|
$(INSTALL) -m 755 $(HASHCAT_LIBRARY) $(DESTDIR)$(LIBRARY_FOLDER)/
|
2016-01-02 16:42:47 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_library_dev
|
2018-01-26 19:04:32 +00:00
|
|
|
install_library_dev: install_make_library_dev_root
|
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_DEV_FOLDER)
|
|
|
|
$(FIND) include/ -mindepth 1 -type d -execdir $(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_DEV_FOLDER)/{} \;
|
|
|
|
$(FIND) include/ -mindepth 1 -type f -execdir $(INSTALL) -m 644 {} $(DESTDIR)$(LIBRARY_DEV_FOLDER)/{} \;
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: install_hashcat
|
2016-12-29 19:40:07 +00:00
|
|
|
install_hashcat: $(HASHCAT_FRONTEND)
|
2018-01-26 15:29:03 +00:00
|
|
|
$(INSTALL) -m 755 -d $(DESTDIR)$(INSTALL_FOLDER)
|
|
|
|
$(INSTALL) -m 755 $(HASHCAT_FRONTEND) $(DESTDIR)$(INSTALL_FOLDER)/
|
2016-10-13 15:27:09 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: uninstall
|
2016-12-29 19:40:07 +00:00
|
|
|
uninstall:
|
|
|
|
$(RM) -f $(DESTDIR)$(INSTALL_FOLDER)/$(HASHCAT_FRONTEND)
|
|
|
|
$(RM) -f $(DESTDIR)$(LIBRARY_FOLDER)/$(HASHCAT_LIBRARY)
|
2018-01-26 19:04:32 +00:00
|
|
|
$(RM) -rf $(DESTDIR)$(LIBRARY_DEV_FOLDER)
|
2016-12-29 19:40:07 +00:00
|
|
|
$(RM) -rf $(DESTDIR)$(SHARED_FOLDER)
|
|
|
|
$(RM) -rf $(DESTDIR)$(DOCUMENT_FOLDER)
|
2016-10-13 15:27:09 +00:00
|
|
|
|
|
|
|
##
|
2016-12-29 19:40:07 +00:00
|
|
|
## native compiled hashcat library and frontend
|
2016-10-13 15:27:09 +00:00
|
|
|
##
|
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
obj/%.NATIVE.o: src/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC) -c $(CCFLAGS) $(CFLAGS_NATIVE) $< -o $@ -fpic
|
2016-10-13 15:27:09 +00:00
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
ifeq ($(USE_SYSTEM_LZMA),0)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.LZMA.NATIVE.o: $(DEPS_LZMA_PATH)/%.c
|
2021-08-25 15:23:49 +00:00
|
|
|
$(CC) -c $(CCFLAGS) $(CFLAGS_NATIVE) $(CFLAGS_LZMA) $< -o $@ -fpic
|
2018-10-28 15:47:13 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-07 13:31:11 +00:00
|
|
|
ifeq ($(USE_SYSTEM_ZLIB),0)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.ZLIB.NATIVE.o: $(DEPS_ZLIB_PATH)/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC) -c $(CCFLAGS) $(CFLAGS_NATIVE) $(CFLAGS_ZLIB) $< -o $@ -fpic
|
2019-05-07 13:31:11 +00:00
|
|
|
endif
|
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
ifeq ($(USE_SYSTEM_XXHASH),0)
|
|
|
|
ifeq ($(ENABLE_BRAIN),1)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.XXHASH.NATIVE.o: $(DEPS_XXHASH_PATH)/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC) -c $(CCFLAGS) $(CFLAGS_NATIVE) $< -o $@ -fpic
|
|
|
|
endif
|
2018-07-23 11:36:23 +00:00
|
|
|
endif
|
2020-09-08 08:51:15 +00:00
|
|
|
|
2021-05-14 22:04:08 +00:00
|
|
|
ifeq ($(ENABLE_UNRAR),1)
|
2020-09-08 08:51:15 +00:00
|
|
|
ifeq ($(USE_SYSTEM_UNRAR),0)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.UNRAR.NATIVE.o: $(DEPS_UNRAR_PATH)/%.cpp
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CXX) -c $(CXXFLAGS) $(CFLAGS_NATIVE) $(CFLAGS_UNRAR) $< -o $@ -fpic
|
2018-07-23 11:36:23 +00:00
|
|
|
endif
|
2018-11-08 11:52:06 +00:00
|
|
|
endif
|
2018-07-23 11:36:23 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
obj/combined.NATIVE.a: $(NATIVE_OBJS)
|
|
|
|
$(AR) rcs $@ $^
|
|
|
|
|
2018-07-23 21:09:37 +00:00
|
|
|
ifeq ($(UNAME),Darwin)
|
2019-04-03 13:37:29 +00:00
|
|
|
$(HASHCAT_LIBRARY): $(NATIVE_OBJS)
|
2018-07-27 17:55:51 +00:00
|
|
|
$(CC) $^ -o $@ $(LFLAGS_NATIVE) -shared -install_name $(DESTDIR)$(LIBRARY_FOLDER)/$(HASHCAT_LIBRARY) -current_version $(VERSION_PURE) -compatibility_version $(VERSION_PURE)
|
2018-07-23 21:09:37 +00:00
|
|
|
else
|
2019-04-03 13:37:29 +00:00
|
|
|
$(HASHCAT_LIBRARY): $(NATIVE_OBJS)
|
2018-01-26 19:04:32 +00:00
|
|
|
$(CC) $^ -o $@ $(LFLAGS_NATIVE) -shared -Wl,-soname,$(HASHCAT_LIBRARY)
|
2018-07-23 21:09:37 +00:00
|
|
|
endif
|
2017-01-24 15:07:59 +00:00
|
|
|
|
2017-01-27 08:58:01 +00:00
|
|
|
ifeq ($(SHARED),1)
|
|
|
|
$(HASHCAT_FRONTEND): src/main.c $(HASHCAT_LIBRARY)
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC) $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(HASHCAT_LIBRARY) $(LFLAGS_NATIVE) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\"
|
2017-01-27 08:58:01 +00:00
|
|
|
else
|
2019-04-03 13:37:29 +00:00
|
|
|
$(HASHCAT_FRONTEND): src/main.c obj/combined.NATIVE.a
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC) $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\"
|
2017-01-27 08:58:01 +00:00
|
|
|
endif
|
2016-01-02 16:42:47 +00:00
|
|
|
|
2018-12-06 13:02:10 +00:00
|
|
|
##
|
|
|
|
## native compiled modules
|
|
|
|
##
|
|
|
|
|
2019-01-20 18:27:54 +00:00
|
|
|
MODULE_SUFFIX := so
|
|
|
|
|
|
|
|
ifeq ($(UNAME),CYGWIN)
|
|
|
|
MODULE_SUFFIX := dll
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(UNAME),MSYS2)
|
|
|
|
MODULE_SUFFIX := dll
|
|
|
|
endif
|
|
|
|
|
2019-01-13 14:28:42 +00:00
|
|
|
MODULES_SRC := $(wildcard src/modules/*.c)
|
2021-05-14 22:04:08 +00:00
|
|
|
|
|
|
|
MODULES_DISABLE ?=
|
|
|
|
|
|
|
|
ifeq ($(ENABLE_UNRAR),0)
|
|
|
|
MODULES_SRC := $(filter-out src/modules/module_23800.c,$(MODULES_SRC))
|
|
|
|
MODULES_DISABLE += modules/module_23800.so
|
|
|
|
MODULES_DISABLE += modules/module_23800.dll
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(MODULES_DISABLE): ;
|
2018-12-19 12:43:45 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
ifeq ($(SHARED),1)
|
|
|
|
modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c $(HASHCAT_LIBRARY)
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC) $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
|
2019-04-03 13:37:29 +00:00
|
|
|
else
|
|
|
|
modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c obj/combined.NATIVE.a
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC) $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
|
2019-04-03 13:37:29 +00:00
|
|
|
endif
|
2018-12-19 12:43:45 +00:00
|
|
|
|
2021-05-14 22:04:08 +00:00
|
|
|
MODULES_LIB := $(patsubst src/modules/module_%.c, modules/module_%.$(MODULE_SUFFIX), $(MODULES_SRC))
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: modules
|
2018-12-19 14:20:48 +00:00
|
|
|
modules: $(MODULES_LIB)
|
2018-12-06 13:02:10 +00:00
|
|
|
|
2019-02-22 20:58:33 +00:00
|
|
|
##
|
|
|
|
## Cross Compilation (binary release version)
|
|
|
|
##
|
|
|
|
|
|
|
|
ifeq ($(UNAME),Linux)
|
|
|
|
|
|
|
|
##
|
|
|
|
## Compiler paths
|
|
|
|
##
|
|
|
|
|
|
|
|
CC_LINUX := gcc
|
2020-09-08 08:51:15 +00:00
|
|
|
CXX_LINUX := g++
|
2019-02-22 20:58:33 +00:00
|
|
|
CC_WIN := x86_64-w64-mingw32-gcc
|
2020-09-08 08:51:15 +00:00
|
|
|
CXX_WIN := x86_64-w64-mingw32-g++
|
2019-02-22 20:58:33 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
AR_LINUX := ar
|
|
|
|
AR_WIN := x86_64-w64-mingw32-ar
|
|
|
|
|
2019-02-22 20:58:33 +00:00
|
|
|
## To compile win-iconv with mingw clone from here: https://github.com/win-iconv/win-iconv
|
|
|
|
##
|
|
|
|
## Then patch the makefile with the patches from tools/win-iconv-64.diff and run make install
|
|
|
|
##
|
|
|
|
|
|
|
|
WIN_ICONV := /opt/win-iconv-64
|
|
|
|
|
|
|
|
##
|
|
|
|
## Compiler options
|
|
|
|
##
|
|
|
|
|
|
|
|
CFLAGS_CROSS_LINUX := $(CFLAGS)
|
|
|
|
CFLAGS_CROSS_LINUX += -fPIC
|
|
|
|
CFLAGS_CROSS_LINUX += -DWITH_HWMON
|
|
|
|
CFLAGS_CROSS_WIN := $(CFLAGS)
|
|
|
|
CFLAGS_CROSS_WIN += -fPIC
|
|
|
|
CFLAGS_CROSS_WIN += -I$(WIN_ICONV)/include/
|
|
|
|
CFLAGS_CROSS_WIN += -DWITH_HWMON
|
|
|
|
|
|
|
|
LFLAGS_CROSS_LINUX := $(LFLAGS)
|
|
|
|
LFLAGS_CROSS_LINUX += -lpthread
|
|
|
|
LFLAGS_CROSS_LINUX += -ldl
|
|
|
|
LFLAGS_CROSS_LINUX += -lm
|
|
|
|
LFLAGS_CROSS_WIN := $(LFLAGS)
|
|
|
|
LFLAGS_CROSS_WIN += -Wl,--dynamicbase
|
|
|
|
LFLAGS_CROSS_WIN += -Wl,--nxcompat
|
|
|
|
LFLAGS_CROSS_WIN += -lpsapi
|
|
|
|
LFLAGS_CROSS_WIN += -lws2_32
|
2020-09-08 08:51:15 +00:00
|
|
|
LFLAGS_CROSS_WIN += -lpowrprof
|
|
|
|
LFLAGS_CROSS_WIN += -static -static-libgcc -static-libstdc++
|
2019-02-22 20:58:33 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
## Targets
|
|
|
|
##
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: binaries
|
2019-02-22 20:58:33 +00:00
|
|
|
binaries: linux win
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: host_linux host_win
|
2019-02-22 20:58:33 +00:00
|
|
|
host_linux: hashcat.bin
|
|
|
|
host_win: hashcat.exe
|
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: linux win
|
2019-02-22 20:58:33 +00:00
|
|
|
linux: host_linux modules_linux
|
|
|
|
win: host_win modules_win
|
|
|
|
|
2019-01-14 14:15:21 +00:00
|
|
|
##
|
|
|
|
## cross compiled modules
|
|
|
|
##
|
2018-12-19 15:18:40 +00:00
|
|
|
|
2019-02-22 20:36:02 +00:00
|
|
|
MODULES_LIB_LINUX := $(patsubst src/modules/module_%.c, modules/module_%.so, $(MODULES_SRC))
|
|
|
|
MODULES_LIB_WIN := $(patsubst src/modules/module_%.c, modules/module_%.dll, $(MODULES_SRC))
|
2019-01-13 18:16:00 +00:00
|
|
|
|
2020-10-06 15:09:25 +00:00
|
|
|
.PHONY: modules_linux modules_win
|
2019-02-22 20:36:02 +00:00
|
|
|
modules_linux: $(MODULES_LIB_LINUX)
|
|
|
|
modules_win: $(MODULES_LIB_WIN)
|
2018-12-19 15:18:40 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
modules/module_%.so: src/modules/module_%.c obj/combined.LINUX.a
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_LINUX) $(CCFLAGS) $(CFLAGS_CROSS_LINUX) $^ -o $@ $(LFLAGS_CROSS_LINUX) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
|
2018-12-19 15:18:40 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
modules/module_%.dll: src/modules/module_%.c obj/combined.WIN.a
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) $^ -o $@ $(LFLAGS_CROSS_WIN) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
|
2018-12-19 15:18:40 +00:00
|
|
|
|
2016-01-02 16:42:47 +00:00
|
|
|
##
|
2016-12-29 19:40:07 +00:00
|
|
|
## cross compiled hashcat
|
2015-12-04 14:47:52 +00:00
|
|
|
##
|
|
|
|
|
2019-02-22 20:36:02 +00:00
|
|
|
obj/%.LINUX.o: src/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_LINUX) $(CCFLAGS) $(CFLAGS_CROSS_LINUX) -c -o $@ $<
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2019-02-22 20:36:02 +00:00
|
|
|
obj/%.WIN.o: src/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) -c -o $@ $<
|
2015-12-04 14:47:52 +00:00
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
ifeq ($(USE_SYSTEM_LZMA),0)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.LZMA.LINUX.o: $(DEPS_LZMA_PATH)/%.c
|
2021-08-25 15:23:49 +00:00
|
|
|
$(CC_LINUX) $(CCFLAGS) $(CFLAGS_CROSS_LINUX) $(CFLAGS_LZMA) -c -o $@ $<
|
2018-10-28 15:47:13 +00:00
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.LZMA.WIN.o: $(DEPS_LZMA_PATH)/%.c
|
2021-08-25 15:23:49 +00:00
|
|
|
$(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) $(CFLAGS_LZMA) -c -o $@ $<
|
2018-10-28 15:47:13 +00:00
|
|
|
endif
|
|
|
|
|
2019-05-07 13:31:11 +00:00
|
|
|
ifeq ($(USE_SYSTEM_ZLIB),0)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.ZLIB.LINUX.o: $(DEPS_ZLIB_PATH)/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_LINUX) $(CCFLAGS) $(CFLAGS_CROSS_LINUX) $(CFLAGS_ZLIB) -c -o $@ $<
|
2019-05-07 13:31:11 +00:00
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.ZLIB.WIN.o: $(DEPS_ZLIB_PATH)/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) $(CFLAGS_ZLIB) -c -o $@ $<
|
2019-05-07 13:31:11 +00:00
|
|
|
endif
|
|
|
|
|
2018-11-08 11:52:06 +00:00
|
|
|
ifeq ($(USE_SYSTEM_XXHASH),0)
|
|
|
|
ifeq ($(ENABLE_BRAIN),1)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.XXHASH.LINUX.o: $(DEPS_XXHASH_PATH)/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_LINUX) $(CCFLAGS) $(CFLAGS_CROSS_LINUX) -c -o $@ $<
|
2018-07-23 11:36:23 +00:00
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.XXHASH.WIN.o: $(DEPS_XXHASH_PATH)/%.c
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) -c -o $@ $<
|
|
|
|
endif
|
2018-07-23 11:36:23 +00:00
|
|
|
endif
|
2020-09-08 08:51:15 +00:00
|
|
|
|
2021-05-14 22:04:08 +00:00
|
|
|
ifeq ($(ENABLE_UNRAR),1)
|
2020-09-08 08:51:15 +00:00
|
|
|
ifeq ($(USE_SYSTEM_UNRAR),0)
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.UNRAR.LINUX.o: $(DEPS_UNRAR_PATH)/%.cpp
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CXX_LINUX) $(CXXFLAGS) $(CFLAGS_CROSS_LINUX) $(CFLAGS_UNRAR) -c -o $@ $<
|
|
|
|
|
2021-08-25 13:17:37 +00:00
|
|
|
obj/%.UNRAR.WIN.o: $(DEPS_UNRAR_PATH)/%.cpp
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CXX_WIN) $(CXXFLAGS) $(CFLAGS_CROSS_WIN) $(CFLAGS_UNRAR) -c -o $@ $<
|
2018-07-23 11:36:23 +00:00
|
|
|
endif
|
2018-11-08 11:52:06 +00:00
|
|
|
endif
|
2018-07-23 11:36:23 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
obj/combined.LINUX.a: $(LINUX_OBJS)
|
|
|
|
$(AR_LINUX) rcs $@ $^
|
|
|
|
|
|
|
|
obj/combined.WIN.a: $(WIN_OBJS)
|
|
|
|
$(AR_WIN) rcs $@ $^
|
|
|
|
|
|
|
|
hashcat.bin: src/main.c obj/combined.LINUX.a
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_LINUX) $(CCFLAGS) $(CFLAGS_CROSS_LINUX) -o $@ $^ $(LFLAGS_CROSS_LINUX) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\"
|
2016-12-28 13:05:26 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
hashcat.exe: src/main.c obj/combined.WIN.a $(WIN_ICONV)/lib/libiconv.a
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) -o $@ $^ $(LFLAGS_CROSS_WIN) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\"
|
2016-12-28 13:05:26 +00:00
|
|
|
|
2019-04-03 13:37:29 +00:00
|
|
|
hashcat.dll: src/main.c obj/combined.WIN.a $(WIN_ICONV)/lib/libiconv.a
|
2020-09-08 08:51:15 +00:00
|
|
|
$(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) -o $@ $^ $(LFLAGS_CROSS_WIN) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -shared
|
2019-02-22 20:58:33 +00:00
|
|
|
|
|
|
|
endif
|
2021-08-31 18:54:32 +00:00
|
|
|
|
|
|
|
# Give plugin developers a chance to add some 3rd party libraries
|
|
|
|
include $(wildcard src/modules/module_*.mk)
|