]> git.cryptolib.org Git - arm-crypto-lib.git/blobdiff - arm-makefile.inc
fixing sha256
[arm-crypto-lib.git] / arm-makefile.inc
index 98ac3beac5feb36ab8d09bf44d37b7bc70cd50c8..e565ddc7f87d0a80fc571ab320bd40165dc36365 100644 (file)
@@ -1,53 +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/
-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      = -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) 
-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)  
+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,-Map,# no space at the end
-override ASFLAGS          = -mthumb -mcpu=$(MCU_TARGET) -Wa,--g -Wa,-mthumb
+                         -Wl,--entry=reset_isr  \
+                         -Wl,-Map,# no space at the end
+                          
+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