-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (23 loc) · 800 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
CC = gcc
CFLAGS = -Wall -Wextra -g -fPIC
LDFLAGS = -ldl -lpthread -lssl
SRC_DIR = src
OBJ_DIR = obj
INCLUDE_DIR = include
MALWARE_SRCS = $(wildcard $(SRC_DIR)/malware/*.c)
MALWARE_OBJS = $(MALWARE_SRCS:$(SRC_DIR)/malware/%.c=$(OBJ_DIR)/malware_%.o)
C2_SRCS = $(wildcard $(SRC_DIR)/c2/*.c)
C2_OBJS = $(C2_SRCS:$(SRC_DIR)/c2/%.c=$(OBJ_DIR)/c2_%.o)
all: directories malware c2
directories:
@mkdir -p $(OBJ_DIR)
malware: $(MALWARE_OBJS)
$(CC) $(CFLAGS) -shared -o malware.so $(MALWARE_OBJS) $(LDFLAGS)
c2: $(C2_OBJS)
$(CC) $(CFLAGS) -o c2_server $(C2_OBJS) $(LDFLAGS)
$(OBJ_DIR)/malware_%.o: $(SRC_DIR)/malware/%.c
$(CC) $(CFLAGS) -I$(INCLUDE_DIR) -c $< -o $@
$(OBJ_DIR)/c2_%.o: $(SRC_DIR)/c2/%.c
$(CC) $(CFLAGS) -I$(INCLUDE_DIR) -c $< -o $@
clean:
rm -rf $(OBJ_DIR) malware.so c2_server