aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/zpu/CMakeLists.txt
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-10 12:23:08 -0800
committerJosh Blum <josh@joshknows.com>2011-01-10 12:23:08 -0800
commit2106c6cf594866061f56b09d1396bb80df51802e (patch)
tree65c94c63d5737d88653d87e7285627650318b55a /firmware/zpu/CMakeLists.txt
parent916223ef3544452bee57b08f9593aa9da66212a5 (diff)
downloaduhd-2106c6cf594866061f56b09d1396bb80df51802e.tar.gz
uhd-2106c6cf594866061f56b09d1396bb80df51802e.tar.bz2
uhd-2106c6cf594866061f56b09d1396bb80df51802e.zip
usrp2: firmware pad bins to zero to deal with optimizing out the static vars that init to zero
removed the spi flash init in favor of an initialization constant at zero tweaked the cmakelists flags list added pad option to the gen binaries macro
Diffstat (limited to 'firmware/zpu/CMakeLists.txt')
-rw-r--r--firmware/zpu/CMakeLists.txt24
1 files changed, 12 insertions, 12 deletions
diff --git a/firmware/zpu/CMakeLists.txt b/firmware/zpu/CMakeLists.txt
index f79e48f8a..9a32d1834 100644
--- a/firmware/zpu/CMakeLists.txt
+++ b/firmware/zpu/CMakeLists.txt
@@ -20,6 +20,7 @@
########################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(CMAKE_C_COMPILER zpu-elf-gcc)
+#force the compiler because the check wont use the special flag below
SET(CMAKE_C_COMPILER_WORKS TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
PROJECT(USRP_NXXX_FW C)
@@ -40,7 +41,11 @@ INCLUDE_DIRECTORIES(
# misc flags for the gcc compiler
########################################################################
SET(CMAKE_C_FLAGS -phi) #always needed compile time and link time
-ADD_DEFINITIONS(-Os --std=gnu99 -Wall -Werror-implicit-function-declaration -ffunction-sections)
+ADD_DEFINITIONS(-Os)
+ADD_DEFINITIONS(--std=gnu99)
+ADD_DEFINITIONS(-Wall)
+ADD_DEFINITIONS(-Werror-implicit-function-declaration)
+ADD_DEFINITIONS(-ffunction-sections)
MACRO(ADD_LINKER_FLAGS flags)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flags}")
@@ -74,37 +79,32 @@ FIND_PROGRAM(HEXDUMP hexdump)
########################################################################
# helper functions to build output formats
########################################################################
-MACRO(GEN_OUTPUTS target)
+MACRO(GEN_OUTPUTS target pad)
GET_FILENAME_COMPONENT(name ${target} NAME_WE)
#command to create a map from elf
ADD_CUSTOM_COMMAND(
OUTPUT ${name}.map DEPENDS ${target}
- COMMAND ${LINKER}
- ARGS -Map ${name}.map ${target}
+ COMMAND ${LINKER} -Map ${name}.map ${target}
)
#command to create a bin from elf
ADD_CUSTOM_COMMAND(
OUTPUT ${name}.bin DEPENDS ${target}
- COMMAND ${OBJCOPY}
- ARGS -O binary ${target} ${name}.bin
+ COMMAND ${OBJCOPY} --pad-to ${pad} -O binary ${target} ${name}.bin
)
#command to create a ihx from elf
ADD_CUSTOM_COMMAND(
OUTPUT ${name}.ihx DEPENDS ${target}
- COMMAND ${OBJCOPY}
- ARGS -O ihex ${target} ${name}.ihx
+ COMMAND ${OBJCOPY} --pad-to ${pad} -O ihex ${target} ${name}.ihx
)
#command to create a dump from elf
ADD_CUSTOM_COMMAND(
OUTPUT ${name}.dump DEPENDS ${target}
- COMMAND ${OBJDUMP}
- ARGS -DSC ${target} > ${name}.dump
+ COMMAND ${OBJDUMP} -DSC ${target} > ${name}.dump
)
#command to create a rom from bin
ADD_CUSTOM_COMMAND(
OUTPUT ${name}.rom DEPENDS ${name}.bin
- COMMAND ${HEXDUMP}
- ARGS -v -e'1/1 \"%.2X\\n\"' ${name}.bin > ${name}.rom
+ COMMAND ${HEXDUMP} -v -e'1/1 \"%.2X\\n\"' ${name}.bin > ${name}.rom
)
#add a top level target for output files
ADD_CUSTOM_TARGET(