#----------------------------------------------------------------------------

# Target file name (without extension).
# This is the name of the compiled .hex file.
TARGET = simple-speck

# Set platform and target
PLATFORM=CWLITEARM
CRYPTO_TARGET=NONE

# List C source files here.
# Header files (.h) are automatically pulled in.
SRC += simple-speck.c
SRC += speck3264.c
#SRC += helper.c

# -----------------------------------------------------------------------------


ifeq ($(CRYPTO_OPTIONS),)
CRYPTO_OPTIONS = AES128C
endif

#Add simpleserial project to build
include deps/Makefile.simpleserial

FIRMWAREPATH = deps/
include $(FIRMWAREPATH)/Makefile.inc

helper:
	arm-none-eabi-gcc -c -mcpu=cortex-m4 -I. -mthumb -mfloat-abi=soft -fmessage-length=0 -ffunction-sections -gdwarf-2 -DSS_VER=SS_VER_1_1 -DSTM32F303xC -DSTM32F3 -DSTM32 -DDEBUG -DHAL_TYPE=HAL_stm32f3 -DPLATFORM=CWLITEARM -DF_CPU=7372800UL -DSS_VER_2_0=2 -DSS_VER_2_1=3 -DSS_VER_1_1=1 -DSS_VER_1_0=0 -DARM=1 -O0 -funsigned-char -funsigned-bitfields -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=objdir-CWLITEARM/helper.lst -Ideps//simpleserial/ -Ideps//hal -Ideps//hal/stm32f3 -Ideps//hal/stm32f3/CMSIS -Ideps//hal/stm32f3/CMSIS/core -Ideps//hal/stm32f3/CMSIS/device -Ideps//hal/stm32f4/Legacy -std=gnu99  -MMD -MP -MF .dep/helper.o.d helper.c -o ./helper.o

test:
	gcc test.c -o tb

local:
	gcc speck3264.c -o speck
run:
	qemu-arm -g 1234 ./simple-speck-CWLITEARM.elf
dbg:
	arm-none-eabi-gdb --eval-command "target remote localhost:1234" ./simple-speck-CWLITEARM.elf