-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
46 lines (34 loc) · 971 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
40
41
42
43
44
45
46
include ../target.mk
vpath %.c src:$(TOOLS):$(TOOLS)/aes_128
vpath %.o $(TMP)
vpath %.d $(TMP)
AES_VAL_SRC = aes_128_key_schedule.c \
aes_128_mix_columns.c \
aes_128_s_box.c \
aes_128_shift_rows.c \
aes_128_validation.c \
aes_128.c \
xor.c \
pkcs7.c \
b64.c
TMP_AES_VAL_OBJS = $(AES_VAL_SRC:.c=.o)
AES_VAL_OBJS = $(addprefix $(TMP)/, $(TMP_AES_VAL_OBJS))
OBJS := b64.o main.o
OBJS := $(addprefix $(TMP)/, $(OBJS))
DEP = $(OBJS:.o=.d)
all : build_dir build solve
.PHONY: libaes_128
libaes_128:
$(MAKE) -C $(TOOLS) aes_128
build: build_dir $(OBJS) libaes_128
$(CC) $(CFLAGS) -static -L$(TOOLS_LIB) $(OBJS) -o $(TARGET) -laes_128
.PHONY: validate
validate: $(AES_VAL_OBJS)
gcc -g -Wall $(AES_VAL_OBJS) -o $(BIN)/aes_val
$(BIN)/aes_val
.PHONY: solve
solve: build
$(TARGET) < input.txt | tee result.txt
@$(ECHO_NE)
# count the number of different lines :
diff -U 0 result.txt solution.txt | grep ^@ | wc -l