44 lines
961 B
Makefile
44 lines
961 B
Makefile
MCU ?= cortex-m7
|
|
WFLAGS ?= -Wall -Wextra -Wmissing-prototypes -Wdiv-by-zero -Wbad-function-cast -Wcast-align -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wnested-externs -Wno-unknown-pragmas -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wno-type-limits
|
|
CFLAGS ?= -Os -mcpu=$(MCU) -mthumb -mpure-code -fno-exceptions -ffunction-sections -fdata-sections -flto $(WFLAGS)
|
|
CFLAGS += -DCHIBIOS
|
|
CFLAGS += -I.
|
|
OBJ = hydrogen.o
|
|
AR ?= arm-none-eabi-ar
|
|
CC = arm-none-eabi-gcc
|
|
RANLIB ?= arm-none-eabi-ranlib
|
|
|
|
SRC = \
|
|
hydrogen.c \
|
|
hydrogen.h \
|
|
impl/common.h \
|
|
impl/core.h \
|
|
impl/gimli-core.h \
|
|
impl/hash.h \
|
|
impl/hydrogen_p.h \
|
|
impl/kdf.h \
|
|
impl/kx.h \
|
|
impl/pwhash.h \
|
|
impl/random.h \
|
|
impl/secretbox.h \
|
|
impl/sign.h \
|
|
impl/x25519.h
|
|
|
|
all: lib
|
|
|
|
lib: libhydrogen.a
|
|
|
|
$(OBJ): $(SRC)
|
|
|
|
libhydrogen.a: $(OBJ)
|
|
$(AR) -r $@ $^
|
|
$(RANLIB) $@
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
rm -f libhydrogen.a $(OBJ)
|
|
rm -f tests/tests tests/*.done
|
|
|
|
distclean: clean
|