2022-04-14 00:27:12 +00:00
|
|
|
CC = gcc
|
2022-04-14 02:17:01 +00:00
|
|
|
CFLAGS = -Wall -Wpedantic -Wextra -std=c99 -fstack-protector-all \
|
|
|
|
-fdiagnostics-color=auto
|
|
|
|
DEBUG = -0g -ggdb
|
2022-04-27 08:07:07 +00:00
|
|
|
LINK =
|
|
|
|
LIB_INC =
|
2022-04-14 00:27:12 +00:00
|
|
|
SRC_DIR = src
|
|
|
|
OUT_DIR = bin
|
2022-04-27 08:07:07 +00:00
|
|
|
TARGETS = base64 fixed-xor char-freq-analyze repeating-key-xor aes-ecb
|
2022-04-08 00:51:38 +00:00
|
|
|
|
|
|
|
|
2022-04-14 00:27:12 +00:00
|
|
|
all: $(TARGETS)
|
2022-04-08 00:51:38 +00:00
|
|
|
|
2022-04-27 08:07:07 +00:00
|
|
|
# TODO toggle mbedtls or tiny-AES-c
|
|
|
|
#EXT_INCLUDES = -Iaes-libs/mbedtls/include/
|
|
|
|
#EXT_LIBS = -Laes-libs/mbedtls/library
|
|
|
|
#LDLIBS = -lmbedcrypto
|
|
|
|
#
|
|
|
|
EXT_INCLUDES = -Iaes-libs/tiny-AES-c
|
|
|
|
#EXT_LIBS = -Laes-libs/tiny-AES-c
|
|
|
|
#LDLIBS = -laes
|
|
|
|
|
2022-04-14 00:27:12 +00:00
|
|
|
%: $(SRC_DIR)/%.c
|
2022-04-27 08:07:07 +00:00
|
|
|
$(CC) $(CFLAGS) -o $(OUT_DIR)/$@ $<
|
|
|
|
|
|
|
|
aes-ecb: $(SRC_DIR)/aes-ecb.c
|
|
|
|
$(CC) $(CFLAGS) $(EXT_INCLUDES) $(EXT_LIBS) -o $(OUT_DIR)/$@ $< $(LDLIBS)
|
2022-04-08 00:51:38 +00:00
|
|
|
|
|
|
|
clean:
|
2022-04-14 00:27:12 +00:00
|
|
|
$(RM) *.o $(OUT_DIR)/*
|
|
|
|
|
|
|
|
.PHONY: all clean
|
2022-04-08 00:51:38 +00:00
|
|
|
|