X-Git-Url: https://git.cryptolib.org/?p=arm-crypto-lib.git;a=blobdiff_plain;f=arm-makefile.inc;h=e565ddc7f87d0a80fc571ab320bd40165dc36365;hp=141ed42f91aa2f817bff94faf72dee3544beb9e2;hb=2b0000dcd4848a3231831a79e2cd35c049909ec9;hpb=f59c19cdaa2b415ea72a30083ee7df085c2a6ae9 diff --git a/arm-makefile.inc b/arm-makefile.inc index 141ed42..e565ddc 100644 --- a/arm-makefile.inc +++ b/arm-makefile.inc @@ -1,52 +1,67 @@ - +TOOLCHAIN = arm-none-eabi-# MCU_TARGET = cortex-m3 -OPTIMIZE = -O2 +MCU_OPTS = -mthumb +OPTIMIZE = -O0 -fomit-frame-pointer +DEBUG = -gdwarf-2 +WARNING = -pedantic -Wall -Wstrict-prototypes -Werror DEFS = -D$(call uc, $(subst -,_,$(MCU_TARGET))) -FLASHCMD = arm-elf-gdb -x gdb-flash # -DEP_DIR = deps/ -TEST_DIR = test/ -BIN_DIR = bin/ -TESTBIN_DIR = test_bin/ -TESTSRC_DIR = test_src/ +FLASHCMD = $(OPENOCD) -f openocd.cfg \ + -c "init" \ + -c "halt" \ + -c "flash write_image erase $(1) 0 bin" \ + -c "reset run" \ + -c "shutdown" +DEP_DIR = deps/# +TEST_DIR = test/# +BIN_DIR = bin/# +TESTSRC_DIR = test_src/# ERASECMD = TESTPORT = /dev/ttyUSB1 TESTPORTBAUDR = 115200 TESTLOG_DIR = testlog/# -TESTPREFIX = nessie- +TESTPREFIX = nessie-# SPEEDTOOL = host/get_performance.rb -SPEEDLOG_DIR = speed_log/ +SPEEDLOG_DIR = speed_log/# SPEEDPREFIX = SPEEDCMD = performance SIZE_DIR = size_log/# LIST_DIR = listings/# STAT_DIR = stats/# AUTOASM_DIR = autoasm/# +LIB_DIR = lib/# +LIB_NAME = libcrypto.a AUTOASM_OPT = -S -CC = arm-elf-gcc CSTD = gnu99 +LIBS = c gcc -override CFLAGS_A = -mthumb -ffunction-sections -fdata-sections -MMD \ - -MF$(DEP_DIR)$(patsubst %.o,%.d,$(notdir $(1))) \ - -I. -Itest_src -g -pedantic -std=$(CSTD) \ - -Wall $(OPTIMIZE) -Wstrict-prototypes \ - -mcpu=$(MCU_TARGET) $(DEFS) -override CFLAGS = -mthumb -ffunction-sections -fdata-sections -MMD \ - -MF$(DEP_DIR)$(patsubst %.o,%.d,$(notdir $@)) \ - -I. -Itest_src -g -pedantic -std=$(CSTD) \ - -Wall $(OPTIMIZE) -Wstrict-prototypes \ - -mcpu=$(MCU_TARGET) $(DEFS) +COMMON_FLAGS = -ffunction-sections -fdata-sections \ + $(DEBUG) $(WARNING) -std=$(CSTD) $(OPTIMIZE) \ + -mcpu=$(MCU_TARGET) $(MCU_OPTS) $(DEFS) -MMD +override CFLAGS_A = $(COMMON_FLAGS) \ + -MF$(DEP_DIR)$(patsubst %.o,%.d,$(notdir $(1))) +override CFLAGS = $(COMMON_FLAGS) \ + -MF$(DEP_DIR)$(patsubst %.o,%.d,$(notdir $@)) + override LDFLAGS = -g -T lm3s9b90.ld -Wl,--gc-sections \ - -Wl,--entry=reset_isr -lc -lgcc \ + -Wl,--entry=reset_isr \ -Wl,-Map,# no space at the end -override ASFLAGS = -mthumb -mcpu=$(MCU_TARGET) -Wa,--g + +override ASFLAGS = -mcpu=$(MCU_TARGET) SIZESTAT_FILE = sizestats.txt -OBJCOPY = arm-elf-objcopy -OBJDUMP = arm-elf-objdump -SIZE = arm-elf-size +CC = $(TOOLCHAIN)gcc +OBJCOPY = $(TOOLCHAIN)objcopy +OBJDUMP = $(TOOLCHAIN)objdump +SIZE = $(TOOLCHAIN)size +OPENOCD = openocd READELF = readelf +AR = $(TOOLCHAIN)ar +CHMOD = chmod +CHOWN = chown +CHGRP = chgrp +RM = rm RUBY = ruby GET_TEST = host/get_test.rb MAKE = make