diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-03-31 13:52:25 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2011-03-31 13:52:25 +0200 |
commit | 02ad565b49c916d9e1ca83c2486e6b0e388eb8e8 (patch) | |
tree | 924f5543c76c1d32c1d30e79c5de7b524f9718a5 /SConstruct |
Initial import.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..605ed44 --- /dev/null +++ b/SConstruct @@ -0,0 +1,41 @@ +import os
+
+env = Environment(
+ ENV = os.environ,
+
+ CC = 'arm-none-eabi-gcc',
+ CXX = 'arm-none-eabi-g++',
+ AS = 'arm-none-eabi-gcc',
+ CCFLAGS = '-O2 -Wall -ggdb -mcpu=cortex-m3 -mthumb -ffunction-sections',
+ CXXFLAGS = '-fno-exceptions -fno-rtti',
+ ASFLAGS = '-c -x assembler-with-cpp -mcpu=cortex-m3 -mthumb',
+
+ #CPPDEFINES = [],
+
+ LINK = 'arm-none-eabi-gcc',
+ LINKFLAGS = '-Wall -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Wl,-Tch.ld',
+
+ AR = 'arm-none-eabi-ar',
+ RANLIB = 'arm-none-eabi-ranlib',
+
+ CPPPATH = ['.',
+ 'chibios/os/kernel/include', 'chibios/os/ports/GCC/ARMCMx', 'chibios/os/ports/GCC/ARMCMx/STM32',
+ 'chibios/os/hal/include', 'chibios/os/hal/platforms/STM32',
+ ],
+ #LIBPATH = [],
+
+ #LIBS = []
+)
+
+sources = \
+ Glob('chibios/os/kernel/src/*.c') + \
+ ['chibios/os/ports/GCC/ARMCMx/' + i for i in ('STM32/vectors.c', 'chcore.c', 'chcore_v7m.c', 'nvic.c', 'crt0_v7m.s')] + \
+ Glob('chibios/os/hal/src/*.c') + \
+ Glob('chibios/os/hal/platforms/STM32/*.c')
+
+firmware = env.Program('suzumebachi.elf', Glob('*.cpp') + Glob('*.c') + sources)
+env.Depends(firmware, 'ch.ld')
+
+env.Command('prog', ['suzumebachi.elf'], 'stm32loader -p /dev/tty.usbmodemfa412 -ewv suzumebachi.elf')
+
+Default('suzumebachi.elf')
|