X-Git-Url: https://git.cryptolib.org/?p=arm-crypto-lib.git;a=blobdiff_plain;f=arm-makefile.inc;h=fe5f5dc58ac8f6641cd40aa5d785d59359824383;hp=4987aec9f312e74f46db1cc613f5fe1b714e829c;hb=94f6d6aad57f8d1230409f74e42395edc290668a;hpb=c079867a33440d07e22f93b71365176e20697e52 diff --git a/arm-makefile.inc b/arm-makefile.inc index 4987aec..fe5f5dc 100644 --- a/arm-makefile.inc +++ b/arm-makefile.inc @@ -1,12 +1,18 @@ - +TOOLCHAIN = arm-none-eabi-# MCU_TARGET = cortex-m3 -OPTIMIZE = -O2 +OPTIMIZE = -O0 +DEBUG = -gdwarf-2 +WARNING = -pedantic -Wall -Wstrict-prototypes -Werror DEFS = -D$(call uc, $(subst -,_,$(MCU_TARGET))) -FLASHCMD = arm-elf-gdb -x gdb-flash # +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/ -TESTBIN_DIR = test_bin/ TESTSRC_DIR = test_src/ ERASECMD = TESTPORT = /dev/ttyUSB1 @@ -22,32 +28,31 @@ LIST_DIR = listings/# STAT_DIR = stats/# AUTOASM_DIR = autoasm/# AUTOASM_OPT = -S -CC = arm-elf-gcc +CC = $(TOOLCHAIN)gcc CSTD = gnu99 override CFLAGS_A = -fomit-frame-pointer \ -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) -Wa,-mthumb $(DEFS) + $(DEBUG) $(WARNING) -std=$(CSTD) $(OPTIMIZE) \ + -mcpu=$(MCU_TARGET) $(DEFS) override CFLAGS = -fomit-frame-pointer \ -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) -Wa,-mthumb $(DEFS) + $(DEBUG) $(WARNING) -std=$(CSTD) $(OPTIMIZE) \ + -mcpu=$(MCU_TARGET) $(DEFS) override LDFLAGS = -g -T lm3s9b90.ld -Wl,--gc-sections \ - -Wl,--entry=reset_isr -lc -lgcc \ + -Wl,--entry=reset_isr -lc -lgcc \ -Wl,-Map,# no space at the end -override ASFLAGS = -mthumb -mcpu=$(MCU_TARGET) -Wa,--g -Wa,-mthumb +override ASFLAGS = -mcpu=$(MCU_TARGET) SIZESTAT_FILE = sizestats.txt -OBJCOPY = arm-elf-objcopy -OBJDUMP = arm-elf-objdump -SIZE = arm-elf-size +OBJCOPY = $(TOOLCHAIN)objcopy +OBJDUMP = $(TOOLCHAIN)objdump +SIZE = $(TOOLCHAIN)size +OPENOCD = openocd READELF = readelf RUBY = ruby GET_TEST = host/get_test.rb