From 387a45923c2ea6b223584815c7cd796ae064e22e Mon Sep 17 00:00:00 2001 From: Dominik Riebeling Date: Sat, 8 Aug 2020 20:16:07 +0200 Subject: utils: Add Makefile for our copy of libtomcrypt. Change-Id: I6b9ffe86b9e78b494a3a9211d6e79bb81c9fb6d4 --- utils/tomcrypt/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 utils/tomcrypt/Makefile (limited to 'utils/tomcrypt/Makefile') diff --git a/utils/tomcrypt/Makefile b/utils/tomcrypt/Makefile new file mode 100644 index 0000000000..ce0f9bae47 --- /dev/null +++ b/utils/tomcrypt/Makefile @@ -0,0 +1,41 @@ +# __________ __ ___. +# Open \______ \ ____ ____ | | _\_ |__ _______ ___ +# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +# \/ \/ \/ \/ \/ + +BUILD_DIR := build +TARGET_DIR := . +DEFINES = +CC ?= gcc +ifndef V + SILENT := @ +endif + +CFLAGS := -O3 -g -std=c99 -Wall $(DEFINES) -Isrc/headers +LDFLAGS := + +SOURCES := \ + src/ciphers/aes/aes.c src/ciphers/aes/aes_tab.c \ + src/misc/crypt/crypt_argchk.c src/misc/crypt/crypt_register_cipher.c src/misc/crypt/crypt_cipher_is_valid.c src/misc/crypt/crypt_cipher_descriptor.c \ + src/misc/zeromem.c src/misc/compare_testvector.c \ + src/modes/cbc/cbc_start.c src/modes/cbc/cbc_decrypt.c src/modes/cbc/cbc_encrypt.c \ + src/hashes/sha1.c + + +OBJS := $(addprefix $(BUILD_DIR)/,$(patsubst %.c,%.o,$(SOURCES))) + +LIB := librbtomcrypt.a + +$(LIB): $(OBJS) + $(info AR $(notdir $@)) + $(SILENT)$(CROSS)$(AR) rcs $(TARGET_DIR)/$@ $^ + +$(BUILD_DIR)/%.o: %.c + $(info CC $(notdir $@)) + $(SILENT)mkdir -p $(dir $@) + $(SILENT)$(CROSS)$(CC) $(CFLAGS) -c -o $@ $< + +clean: + rm -fr $(BUILDDIR) $(LIB) -- cgit