35 lines
759 B
Makefile
35 lines
759 B
Makefile
CC = gcc
|
|
CFLAGS = -Wall -Wpedantic -Wextra -std=c99 -fstack-protector-all \
|
|
-fdiagnostics-color=auto
|
|
DEBUG = -0g -ggdb
|
|
LINK =
|
|
LIB_INC =
|
|
SRC_DIR = src
|
|
OUT_DIR = bin
|
|
TARGETS = base64 fixed-xor char-freq-analyze repeating-key-xor aes-ecb
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
# 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
|
|
|
|
#%: $(SRC_DIR)/%.c
|
|
%: $(SRC_DIR)/%.c
|
|
$(CC) $(CFLAGS) -o $(OUT_DIR)/$@ $<
|
|
|
|
aes-ecb: $(SRC_DIR)/aes-ecb.c
|
|
$(CC) $(CFLAGS) $(EXT_INCLUDES) $(EXT_LIBS) -o $(OUT_DIR)/$@ $< $(LDLIBS)
|
|
|
|
clean:
|
|
$(RM) *.o $(OUT_DIR)/*
|
|
|
|
.PHONY: all clean
|
|
|