1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 08:08:10 +00:00

Merge pull request #2571 from ventaquil/master

Declare phony targets in Makefile
This commit is contained in:
Jens Steube 2021-05-05 10:20:25 +02:00 committed by GitHub
commit 7baad686fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -399,8 +399,10 @@ endif
## Targets: Native Compilation
##
.PHONY: default
default: $(HASHCAT_FRONTEND) modules
.PHONY: clean
clean:
$(RM) -f $(HASHCAT_FRONTEND)
$(RM) -f $(HASHCAT_LIBRARY)
@ -421,6 +423,7 @@ clean:
$(RM) -rf *.outfiles
$(RM) -rf kernels
.PHONY: distclean
distclean: clean
$(RM) -f *.restore
$(RM) -f *.potfile
@ -447,6 +450,7 @@ Only Linux, FreeBSD and Darwin can use the 'install' target
endif
endif
.PHONY: install
ifeq ($(SHARED),1)
install: install_docs install_shared install_library install_library_dev install_kernels install_modules install_hashcat
else
@ -456,12 +460,15 @@ endif
# 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)
.PHONY: install_make_library_dev_root
install_make_library_dev_root:
$(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_DEV_ROOT_FOLDER)
.PHONY: install_make_shared_root
install_make_shared_root:
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_ROOT_FOLDER)
.PHONY: install_docs
install_docs: install_make_shared_root
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)
$(INSTALL) -m 755 -d $(DESTDIR)$(DOCUMENT_FOLDER)/charsets
@ -495,34 +502,41 @@ install_docs: install_make_shared_root
$(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example400.sh
$(SED) $(SED_IN_PLACE) 's/\.\/hashcat/hashcat/' $(DESTDIR)$(DOCUMENT_FOLDER)/example500.sh
.PHONY: install_shared
install_shared: install_make_shared_root
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)
$(INSTALL) -m 644 hashcat.hctune $(DESTDIR)$(SHARED_FOLDER)/
$(INSTALL) -m 644 hashcat.hcstat2 $(DESTDIR)$(SHARED_FOLDER)/
.PHONY: install_kernels
install_kernels: install_shared
$(INSTALL) -m 755 -d $(DESTDIR)$(SHARED_FOLDER)/OpenCL
$(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/{} \;
.PHONY: install_modules
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/{} \;
.PHONY: install_library
install_library: $(HASHCAT_LIBRARY)
$(INSTALL) -m 755 -d $(DESTDIR)$(LIBRARY_FOLDER)
$(INSTALL) -m 755 $(HASHCAT_LIBRARY) $(DESTDIR)$(LIBRARY_FOLDER)/
.PHONY: install_library_dev
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)/{} \;
.PHONY: install_hashcat
install_hashcat: $(HASHCAT_FRONTEND)
$(INSTALL) -m 755 -d $(DESTDIR)$(INSTALL_FOLDER)
$(INSTALL) -m 755 $(HASHCAT_FRONTEND) $(DESTDIR)$(INSTALL_FOLDER)/
.PHONY: uninstall
uninstall:
$(RM) -f $(DESTDIR)$(INSTALL_FOLDER)/$(HASHCAT_FRONTEND)
$(RM) -f $(DESTDIR)$(LIBRARY_FOLDER)/$(HASHCAT_LIBRARY)
@ -603,6 +617,7 @@ modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c obj/combined.NATIVE.a
$(CC) $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
endif
.PHONY: modules
modules: $(MODULES_LIB)
##
@ -658,11 +673,14 @@ LFLAGS_CROSS_WIN += -static -static-libgcc -static-libstdc++
## Targets
##
.PHONY: binaries
binaries: linux win
.PHONY: host_linux host_win
host_linux: hashcat.bin
host_win: hashcat.exe
.PHONY: linux win
linux: host_linux modules_linux
win: host_win modules_win
@ -673,6 +691,7 @@ win: host_win modules_win
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))
.PHONY: modules_linux modules_win
modules_linux: $(MODULES_LIB_LINUX)
modules_win: $(MODULES_LIB_WIN)