-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
37 lines (28 loc) · 882 Bytes
/
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
SRCDIR = src
OBJDIR = obj
BINDIR = target
BIN = wpscrack
CC = ./bin/mipsel-openwrt-linux-gcc
CFLAGS = -Wall -g -I./usrinc -I./include -I$(SRCDIR) -fdump-rtl-expand
LFLAGS = -Wall -g -L./usrlib -static -lpcap -lcrypto -ldl
SOURCES := $(wildcard $(SRCDIR)/*.c) $(wildcard $(SRCDIR)/**/*.c)
INCLUDES := $(wildcard $(SRCDIR)/*.h) $(wildcard $(SRCDIR)/**/*.h)
OBJECTS := $(addprefix $(OBJDIR)/,$(notdir $(SOURCES:%.c=%.o)))
VPATH = $(dir $(SOURCES))
export STAGING_DIR=
$(BINDIR)/$(BIN): $(OBJECTS)
@echo "Linking"
$(CC) $(OBJECTS) $(LFLAGS) -o $@
$(OBJECTS): $(OBJDIR)/%.o : %.c
mkdir -p $(OBJDIR)
@$(CC) $(CFLAGS) -c $< -o $@
@echo "Compiled "$<" successfully!"
.PHONY: clean install help
help:
@echo $(SOURCES)
@echo $(OBJECTS)
@echo $(VPATH)
clean:
rm -rf $(BINDIR)/* $(OBJDIR)/*
install: $(BINDIR)/$(BIN)
scp target/wpscrack [email protected]:/root