forked from ZerBea/hcxtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
93 lines (73 loc) · 1.67 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
PREFIX ?=/usr/local
INSTALLDIR = $(DESTDIR)$(PREFIX)/bin
HOSTOS := $(shell uname -s)
CC ?= gcc
CFLAGS ?= -O3 -Wall -Wextra
CFLAGS += -std=gnu99
INSTFLAGS = -m 0755
ifeq ($(HOSTOS), Linux)
INSTFLAGS += -D
endif
ifeq ($(HOSTOS), Darwin)
CFLAGS += -L/usr/local/opt/openssl/lib -I/usr/local/opt/openssl/include
endif
TOOLS=
TOOLS+=hcxpcaptool
hcxpcaptool_libs=-lz -lcrypto
TOOLS+=hcxpsktool
hcxpsktool_libs=-lcrypto
TOOLS+=hcxhashcattool
hcxhashcattool_libs=-lcrypto -lpthread
TOOLS+=wlanhc2hcx
TOOLS+=wlanwkp2hcx
TOOLS+=wlanhcxinfo
TOOLS+=wlanhcx2cap
wlanhcx2cap_libs=-lpcap
TOOLS+=wlanhcx2essid
TOOLS+=wlanhcx2ssid
TOOLS+=wlanhcxmnc
TOOLS+=wlanhashhcx
TOOLS+=wlanhcxcat
wlanhcxcat_libs=-lcrypto
TOOLS+=wlanpmk2hcx
wlanpmk2hcx_libs=-lcrypto
TOOLS+=wlanjohn2hcx
TOOLS+=wlancow2hcxpmk
TOOLS+=whoismac
whoismac_libs=-lcurl
TOOLS+=wlanhcx2john
TOOLS+=wlanhcx2psk
wlanhcx2psk_libs=-lcrypto
TOOLS+=wlancap2wpasec
wlancap2wpasec_libs=-lcurl
.PHONY: build
build: $(TOOLS)
.deps:
mkdir -p .deps
# $1: tool name
define tool-build
$(1)_src ?= $(1).c
$(1)_libs ?=
$(1): $$($(1)_src) | .deps
$$(CC) $$(CFLAGS) $$(CPPFLAGS) -MMD -MF .deps/[email protected] -o $$@ $$($(1)_src) $$($(1)_libs) $$(LDFLAGS)
.deps/$(1).d: $(1)
.PHONY: $(1).install
$(1).install: $(1)
install $$(INSTFLAGS) $(1) $$(INSTALLDIR)/$(1)
.PHONY: $(1).clean
$(1).clean:
rm -f .deps/$(1).d
rm -f $(1)
.PHONY: $(1).uninstall
$(1).uninstall:
rm -rf $$(INSTALLDIR)/$(1)
endef
$(foreach tool,$(TOOLS),$(eval $(call tool-build,$(tool))))
.PHONY: install
install: $(patsubst %,%.install,$(TOOLS))
.PHONY: clean
clean: $(patsubst %,%.clean,$(TOOLS))
rm -rf .deps
.PHONY: uninstall
uninstall: $(patsubst %,%.uninstall,$(TOOLS))
-include .deps/*.d