jamesmunns / kinetis-rs

Attempt to provide rust bindings to the Kinetis SDK
0 stars 10 forks source link

Figure out `-target` #1

Open jamesmunns opened 8 years ago

jamesmunns commented 8 years ago

https://github.com/jamesmunns/kinetis-rs/blob/master/rust/play-with-rbg.sh#L9

jamesmunns commented 8 years ago

@simonsapin

Hey, i've started work here, with a basic (really ugly) example.

Im going off of your old makefile, basically:

PATH="/home/simon/projects/servo/ports/geckolib/binding_tools/rust-bindgen/target/debug:$$PATH" bindgen --no-type-renaming --match teensy3 bindings.h -o src/bindings.rs -- -I/usr/lib/clang/3.8.1/include -x c++ -std=gnu++11 -target thumbv7em-none-eabi -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DUSING_MAKEFILE -D__MK20DX256__ -DARDUINO=10600 -DTEENSYDUINO=121
SimonSapin commented 8 years ago

This PATH variable is obviously specific to my system, so it’s probably not helpful to include it. (Same in your blog post by the way.)

As to -target, like everything after -- in bindgen’s arguments it is passed through to clang. So http://clang.llvm.org/docs/CrossCompilation.html#target-triple is probably relevant.