-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (28 loc) · 1023 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
38
39
OUTDIR = ./bin
SRCDIR = ./src
OBJDIR = ./obj
CC = gcc
RAND_ID_VAL := $(shell bash -c 'echo $$RANDOM')
CFLAGS = -Wall -Werror -D_FORTIFY_SOURCE=2 -s -DRAND_ID=
all: icmp-c2 icmp-implant
icmp-c2: obj/icmp-c2.o obj/c2.o obj/utils.o
$(CC) $(OBJDIR)/icmp-c2.o $(OBJDIR)/c2.o $(OBJDIR)/utils.o -o $(OUTDIR)/icmp-c2 $(CFLAGS)
sudo setcap cap_net_raw=ep $(OUTDIR)/icmp-c2
icmp-implant: obj/icmp-implant.o obj/implant.o obj/utils.o
$(CC) $(OBJDIR)/icmp-implant.o $(OBJDIR)/implant.o $(OBJDIR)/utils.o -o $(OUTDIR)/icmp-implant $(CFLAGS)
obj/icmp-implant.o:
$(CC) $(CFLAGS) -c $(SRCDIR)/icmp-implant.c -o $(OBJDIR)/icmp-implant.o
obj/implant.o:
$(CC) $(CFLAGS)$(RAND_ID_VAL) -c $(SRCDIR)/implant.c -o $(OBJDIR)/implant.o
obj/icmp-c2.o:
$(CC) $(CFLAGS) -c $(SRCDIR)/icmp-c2.c -o $(OBJDIR)/icmp-c2.o
obj/c2.o:
$(CC) $(CFLAGS) -c $(SRCDIR)/c2.c -o $(OBJDIR)/c2.o
obj/utils.o:
$(CC) $(CFLAGS)$(RAND_ID_VAL) -c $(SRCDIR)/utils.c -o $(OBJDIR)/utils.o
clean:
rm -f $(OBJDIR)/* $(OUTDIR)/*
fclean:
clean
re:
fclean all