all repos — cryptopals-challenges @ 7738b97d0a9c77292af74499b45a20bfab599552

cryptopals-challenges

set1/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
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

AES_LIB = mbedtls
#AES_LIB = tiny-AES-c

# choose which AES library to use
ifeq (mbedtls,$(AES_LIB))
    EXT_INCLUDES = -Iaes-libs/mbedtls/include/
    EXT_LIBS     = -Laes-libs/mbedtls/library
    LDLIBS       = -lmbedcrypto
else
    #EXT_INCLUDES = -Iaes-libs/tiny-AES-c
    EXT_LIBS     = -Laes-libs/tiny-AES-c
    #LDLIBS       = -laes
endif


all: $(TARGETS)

%: $(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