1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

Declare phony targets

This commit is contained in:
Konrad Goławski 2020-10-06 17:09:25 +02:00
parent 15bf8b7302
commit 44ceb819fa

View File

@ -395,8 +395,10 @@ endif
## Targets: Native Compilation
##
.PHONY: default
default: $(HASHCAT_FRONTEND) modules
.PHONY: clean
clean:
$(RM) -f $(HASHCAT_FRONTEND)
$(RM) -f $(HASHCAT_LIBRARY)
@ -417,6 +419,7 @@ clean:
$(RM) -rf *.outfiles
$(RM) -rf kernels
.PHONY: distclean
distclean: clean
$(RM) -f *.restore
$(RM) -f *.potfile
@ -443,6 +446,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
@ -452,12 +456,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
@ -491,34 +498,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)
@ -599,6 +613,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)
##
@ -654,11 +669,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
@ -669,6 +687,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)