Skip to content

Instantly share code, notes, and snippets.

@Bigcheese
Created March 3, 2017 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bigcheese/f44e0e9dbdd93abc2f96e35114a1484d to your computer and use it in GitHub Desktop.
Save Bigcheese/f44e0e9dbdd93abc2f96e35114a1484d to your computer and use it in GitHub Desktop.
using clang for mbed with arm gcc embedded.
ninja_required_version = 1.3
root = .
builddir = build
#cxx = ../gcc-arm-none/bin/arm-none-eabi-g++ -v
cxx = clang++ -target arm-none-eabi -I../gcc-arm-none\bin\../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/include/c++/6.3.1 -I../gcc-arm-none\bin\../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/include/c++/6.3.1/arm-none-eabi/thumb/v7e-m -I../gcc-arm-none\bin\../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/include/c++/6.3.1/backward -I../gcc-arm-none\bin\../lib/gcc/arm-none-eabi/6.3.1/include -I../gcc-arm-none\bin\../lib/gcc/arm-none-eabi/6.3.1/include-fixed -I../gcc-arm-none\bin\../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/include
ld = ../gcc-arm-none/bin/arm-none-eabi-gcc
objcopy = ../gcc-arm-none/bin/arm-none-eabi-objcopy
cxxflags = -fshort-enums -std=gnu++98 -fno-rtti -Wvla -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -funsigned-char -fno-delete-null-pointer-checks -fomit-frame-pointer -Os -mcpu=cortex-m4 -mthumb -mfloat-abi=soft
ldflags = -Wl,--gc-sections -Wl,--wrap,main -Wl,--wrap,_malloc_r -Wl,--wrap,_free_r -Wl,--wrap,_realloc_r -Wl,--wrap,_calloc_r -Wl,--wrap,exit -Wl,--wrap,atexit -mcpu=cortex-m4 -mthumb
include_paths = -I. -IAdafruit_GFX -IUSBDevice -IUSBDevice/USBDevice -IUSBDevice/USBSerial -Imbed -Imbed/TARGET_TEENSY3_1 -Imbed/TARGET_TEENSY3_1/TARGET_Freescale -Imbed/TARGET_TEENSY3_1/TARGET_Freescale/TARGET_K20XX -Imbed/TARGET_TEENSY3_1/TARGET_Freescale/TARGET_K20XX/TARGET_TEENSY3_1 -Imbed/TARGET_TEENSY3_1/TARGET_Freescale/TARGET_K20XX/TARGET_TEENSY3_1/device -Imbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM -Imbed/drivers -Imbed/hal -Imbed/platform
library_paths = -Lmbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM
libararies = -l:libmbed.a -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys -l:libmbed.a
linker_script = mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/MK20DX256.ld
sys_objs = mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/PeripheralPins.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/analogin_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/analogout_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/cmsis_nvic.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/gpio_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/gpio_irq_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/i2c_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/mbed_board.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/pinmap.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/port_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/pwmout_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/retarget.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/rtc_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/serial_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/sleep.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/spi_api.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/startup_MK20DX256.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/system_MK20DX256.o mbed/TARGET_TEENSY3_1/TOOLCHAIN_GCC_ARM/us_ticker.o
defines = -D__MBED__=1 -DDEVICE_I2CSLAVE=1 -DTARGET_LIKE_MBED -DTARGET_Freescale -DDEVICE_PORTINOUT=1 -DTARGET_RTOS_M4_M7 -DDEVICE_RTC=1 -DTOOLCHAIN_object -D__CMSIS_RTOS -DTARGET_TEENSY3_1 -DTOOLCHAIN_GCC -DTARGET_CORTEX_M -DTARGET_LIKE_CORTEX_M4 -DDEVICE_ANALOGOUT=1 -DTARGET_M4 -DTARGET_UVISOR_UNSUPPORTED -DDEVICE_SERIAL=1 -DDEVICE_INTERRUPTIN=1 -DDEVICE_I2C=1 -DDEVICE_PORTOUT=1 -D__CORTEX_M4 -DDEVICE_STDIO_MESSAGES=1 -DTARGET_K20DX256 -DDEVICE_PORTIN=1 -DTARGET_RELEASE -DTARGET_K20XX -D__MBED_CMSIS_RTOS_CM -DDEVICE_SLEEP=1 -DTOOLCHAIN_GCC_ARM -DDEVICE_SPI=1 -DDEVICE_ERROR_RED=1 -DDEVICE_SPISLAVE=1 -DDEVICE_ANALOGIN=1 -DDEVICE_PWMOUT=1 -DDEVICE_SEMIHOST=1 -DARM_MATH_CM4 -include mbed_config.h
rule cxx
command = $cxx -MMD -MF $out.d $cxxflags $include_paths $defines -c $in -o $out
description = CXX $out
deps = gcc
depfile = $out.d
rule link
command = $ld $ldflags -T $linker_script $library_paths $in $sys_objs $libararies -o $out
description = LD $out
rule hex
command = $objcopy -O ihex $in $out
description = HEX $out
build $builddir/Adafruit_GFX/Adafruit_GFX.o: cxx $root/Adafruit_GFX/Adafruit_GFX.cpp
build $builddir/Adafruit_GFX/Adafruit_SSD1306.o: cxx $root/Adafruit_GFX/Adafruit_SSD1306.cpp
build $builddir/USBDevice/USBAudio/USBAudio.o: cxx $root/USBDevice/USBAudio/USBAudio.cpp
build $builddir/USBDevice/USBDevice/USBDevice.o: cxx $root/USBDevice/USBDevice/USBDevice.cpp
build $builddir/USBDevice/USBDevice/USBHAL_EFM32.o: cxx $root/USBDevice/USBDevice/USBHAL_EFM32.cpp
build $builddir/USBDevice/USBDevice/USBHAL_KL25Z.o: cxx $root/USBDevice/USBDevice/USBHAL_KL25Z.cpp
build $builddir/USBDevice/USBDevice/USBHAL_LPC11U.o: cxx $root/USBDevice/USBDevice/USBHAL_LPC11U.cpp
build $builddir/USBDevice/USBDevice/USBHAL_LPC17.o: cxx $root/USBDevice/USBDevice/USBHAL_LPC17.cpp
build $builddir/USBDevice/USBDevice/USBHAL_LPC40.o: cxx $root/USBDevice/USBDevice/USBHAL_LPC40.cpp
build $builddir/USBDevice/USBDevice/USBHAL_Maxim.o: cxx $root/USBDevice/USBDevice/USBHAL_Maxim.cpp
build $builddir/USBDevice/USBDevice/USBHAL_RZ_A1H.o: cxx $root/USBDevice/USBDevice/USBHAL_RZ_A1H.cpp
build $builddir/USBDevice/USBDevice/USBHAL_STM32F4.o: cxx $root/USBDevice/USBDevice/USBHAL_STM32F4.cpp
build $builddir/USBDevice/USBHID/USBHID.o: cxx $root/USBDevice/USBHID/USBHID.cpp
build $builddir/USBDevice/USBHID/USBKeyboard.o: cxx $root/USBDevice/USBHID/USBKeyboard.cpp
build $builddir/USBDevice/USBHID/USBMouse.o: cxx $root/USBDevice/USBHID/USBMouse.cpp
build $builddir/USBDevice/USBHID/USBMouseKeyboard.o: cxx $root/USBDevice/USBHID/USBMouseKeyboard.cpp
build $builddir/USBDevice/USBMIDI/USBMIDI.o: cxx $root/USBDevice/USBMIDI/USBMIDI.cpp
build $builddir/USBDevice/USBMSD/USBMSD.o: cxx $root/USBDevice/USBMSD/USBMSD.cpp
build $builddir/USBDevice/USBSerial/USBCDC.o: cxx $root/USBDevice/USBSerial/USBCDC.cpp
build $builddir/USBDevice/USBSerial/USBSerial.o: cxx $root/USBDevice/USBSerial/USBSerial.cpp
build $builddir/main.o: cxx $root/main.cpp
build $builddir/Teensy.elf: link $builddir/Adafruit_GFX/Adafruit_GFX.o $builddir/Adafruit_GFX/Adafruit_SSD1306.o $builddir/USBDevice/USBAudio/USBAudio.o $builddir/USBDevice/USBDevice/USBDevice.o $builddir/USBDevice/USBDevice/USBHAL_EFM32.o $builddir/USBDevice/USBDevice/USBHAL_KL25Z.o $builddir/USBDevice/USBDevice/USBHAL_LPC11U.o $builddir/USBDevice/USBDevice/USBHAL_LPC17.o $builddir/USBDevice/USBDevice/USBHAL_LPC40.o $builddir/USBDevice/USBDevice/USBHAL_Maxim.o $builddir/USBDevice/USBDevice/USBHAL_RZ_A1H.o $builddir/USBDevice/USBDevice/USBHAL_STM32F4.o $builddir/USBDevice/USBHID/USBHID.o $builddir/USBDevice/USBHID/USBKeyboard.o $builddir/USBDevice/USBHID/USBMouse.o $builddir/USBDevice/USBHID/USBMouseKeyboard.o $builddir/USBDevice/USBMIDI/USBMIDI.o $builddir/USBDevice/USBMSD/USBMSD.o $builddir/USBDevice/USBSerial/USBCDC.o $builddir/USBDevice/USBSerial/USBSerial.o $builddir/main.o
build $builddir/Teensy.hex: hex $builddir/Teensy.elf
default $builddir/Teensy.hex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment