Commit ac8d8257 authored by Benoit Rat's avatar Benoit Rat

usb-loader: Add git version to samba applets

parent 74f55464
#!/bin/bash
## The ATMEL boot strap seems to only compile with a specific compiler
# Sourcery G++ Lite 2008q3-39 for ARM EABI
#
# ref: http://www.at91.com/forum/viewtopic.php/f,8/t,5352/
#### Function to compile each modules
compile_module()
{
#Go to the mopdule directory
cd ${root}/${1}
# Obtain the git revision of the module
GITR=`git log --abbrev-commit --pretty=oneline -1 . | cut -d" " -f1`
# Append '+' symbol if some files need to be commited to git
if [[ -n `git status -s .` ]]; then GITS='+'; else GITS=''; fi;
#Compile the module
make CROSS_COMPILE=${CROSS_COMPILE} CHIP=at91sam9g45 BOARD=at91sam9g45-ek MEMORIES=sram TRACE_LEVEL=5 DYN_TRACES=1 DEFINES="-D__GIT__=\\\"${GITR}${GITS}\\\"" INSTALLDIR=../../ $2
}
#### Setup global variable
CROSS_COMPILE=/opt/wrs/misc/cd-g++lite/bin/arm-none-eabi-
root="$(echo $(/bin/pwd)/$dir | sed 's-/.$--')"
#### Compilation of dataflash module
compile_module dataflash $2
#### Compilation of extern ram module
compile_module extram $2
less
......@@ -118,7 +118,7 @@ CFLAGS += -UDYN_TRACES
TR_LEV = 0
endif
CFLAGS += -DTRACE_LEVEL=$(TR_LEV)
CFLAGS += -DTRACE_LEVEL=$(TR_LEV) $(DEFINES)
#-------------------------------------------------------------------------------
......
......@@ -42,6 +42,13 @@
#include <string.h>
//------------------------------------------------------------------------------
// External definitions
//------------------------------------------------------------------------------
#ifndef __GIT__
#define __GIT__ ""
#endif
//------------------------------------------------------------------------------
// Local definitions
//------------------------------------------------------------------------------
......@@ -319,7 +326,7 @@ int main(int argc, char **argv)
TRACE_INFO("-- DataFlash AT45 ISP Applet %s --\n\r", SAM_BA_APPLETS_VERSION);
TRACE_INFO("-- %s\n\r", BOARD_NAME);
TRACE_INFO("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);
TRACE_INFO("-- Compiled: %s %s %s --\n\r", __DATE__, __TIME__,__GIT__);
if (at45Select[at45Index].pSpiHw == 0) {
......
......@@ -95,7 +95,7 @@ endif
CFLAGS += $(TARGET_OPTS)
CFLAGS += -Wall -mlong-calls -ffunction-sections
CFLAGS += -g $(OPTIMIZATION) -mthumb $(INCLUDES) -D$(CHIP) -DDYN_TRACES -DTRACE_DBGU
CFLAGS += -g $(OPTIMIZATION) -mthumb $(INCLUDES) -D$(CHIP) -DDYN_TRACES -DTRACE_DBGU $(DEFINES)
ASFLAGS = $(TARGET_OPTS) -Wall -g $(OPTIMIZATION) $(INCLUDES) -D$(CHIP) -D__ASSEMBLY__
LDFLAGS = -g $(OPTIMIZATION) $(TARGET_OPTS) -Wl,-Map=$(OUTPUT).map,--gc-sections #-nostartfiles
......@@ -148,7 +148,7 @@ VPATH += $(BOARDS)/$(BOARD)
VPATH += $(BOARDS)/$(BOARD)/$(CHIP)
# Objects built from C source files
C_OBJECTS += main.o
C_OBJECTS += main.o memtest.o
C_OBJECTS += board_memories.o
C_OBJECTS += board_lowlevel.o
C_OBJECTS += dbgu.o
......@@ -184,7 +184,7 @@ ASM_OBJECTS_$(1) = $(addprefix $(OBJ)/$(1)_, $(ASM_OBJECTS))
$(1): $$(ASM_OBJECTS_$(1)) $$(C_OBJECTS_$(1))
$(CC) $(LDFLAGS) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$@_samba.lds" -o $(OUTPUT).elf $$^
#bb/init.o bb/ddramc.o
#bb/init.o bb/ddramc.o
$(OBJCOPY) -O binary $(OUTPUT).elf $(OUTPUT).bin
$(SIZE) $$^ $(OUTPUT).elf
@cp -f $(OUTPUT).bin $(INSTALLDIR)
......
......@@ -46,6 +46,9 @@
//------------------------------------------------------------------------------
// External definitions
//------------------------------------------------------------------------------
#ifndef __GIT__
#define __GIT__ ""
#endif
//------------------------------------------------------------------------------
// Local definitions
......@@ -232,7 +235,7 @@ int main(int argc, char **argv)
TRACE_INFO("-- EXTRAM ISP Applet %s --\n\r", SAM_BA_APPLETS_VERSION);
TRACE_INFO("-- %s\n\r", BOARD_NAME);
TRACE_INFO("-- Compiled: %s %s --\n\r", __DATE__, __TIME__);
TRACE_INFO("-- Compiled: %s %s %s --\n\r", __DATE__, __TIME__, __GIT__);
TRACE_INFO("INIT command:\n\r");
TRACE_INFO("\tCommunication link type : %d\n\r", pMailbox->argument.inputInit.comType);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment