{"action":"created","issue":{"url":"https://api.github.com/repos/TMRh20/RF24/issues/231","repository_url":"https://api.github.com/repos/TMRh20/RF24","labels_url":"https://api.github.com/repos/TMRh20/RF24/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/TMRh20/RF24/issues/231/comments","events_url":"https://api.github.com/repos/TMRh20/RF24/issues/231/events","html_url":"https://github.com/TMRh20/RF24/issues/231","id":138101360,"number":231,"title":"makefile improvements","user":{"login":"mz-fuzzy","id":9771301,"avatar_url":"https://avatars.githubusercontent.com/u/9771301?v=3","gravatar_id":"","url":"https://api.github.com/users/mz-fuzzy","html_url":"https://github.com/mz-fuzzy","followers_url":"https://api.github.com/users/mz-fuzzy/followers","following_url":"https://api.github.com/users/mz-fuzzy/following{/other_user}","gists_url":"https://api.github.com/users/mz-fuzzy/gists{/gist_id}","starred_url":"https://api.github.com/users/mz-fuzzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mz-fuzzy/subscriptions","organizations_url":"https://api.github.com/users/mz-fuzzy/orgs","repos_url":"https://api.github.com/users/mz-fuzzy/repos","events_url":"https://api.github.com/users/mz-fuzzy/events{/privacy}","received_events_url":"https://api.github.com/users/mz-fuzzy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/TMRh20/RF24/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-03-03T07:38:52Z","updated_at":"2016-04-01T19:32:16Z","closed_at":null,"body":"Hi guys,\r\n\r\nI've done some improvements into my clone:\r\nhttps://github.com/mz-fuzzy/RF24/tree/makefile_improvements\r\n\r\nWhat is there:\r\n\r\n- introduction of \"configure\" script. Run \"./configure --help\" for info.\r\n- including suport of LittleWire into main makefile & adaptations needed for that\r\n- BBB driver renamed to SPIDEV (because it is SPIDEV :-)\r\n- examples_RPi renamed to examples_linux\r\n- pyRF24 dir moved one level up directly to library dir\r\n- SPIDEV now works with any /dev/spidevX.X [ /dev/spidev2.3 -> RF24(n, 23); ]\r\n- autodetection of driver - RPi, SPIDEV, MRAA, LittleWire\r\n- autodetection of HW/SoC - BCM2835/RPi, BCM2836/RPi2, AM33XX/BBB, A10, A13, A20 with assignment of optimal gcc optimizing flags\r\n- support of cross compiling including remote upload/installation (also for python wrapper)\r\n- python wrapper compilation uses same cpu flags/optimizations as main rf24 lib\r\n- python installer now uses setuptools instead of distutils (needed for cross compiling)\r\n\r\nAt the moment I it's not tested enough to be ready for a pull request and maybe some of changes need discussion, but I think it's pretty usable, so I'd be glad if you can check it out and provide feedback/opinions.\r\n\r\nto clone:\r\n`git clone https://github.com/mz-fuzzy/RF24.git -b makefile_improvements`\r\n\r\nto compile on an arm hosts:\r\n`./configure`\r\n`make`\r\n`make install`\r\n\r\nto cross-compile rf24 library:\r\n- get cross compiler environment, for example for RPi\r\n\r\n`git clone https://github.com/raspberrypi/tools rpi-tools`\r\n- set path to binaries there, like\r\n\r\n`export PATH=$PATH:/your/dir/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin`\r\n- best if you have your target machine accessible via ssh now. Assure password-less login and sudo rights for user which you'll use on it.\r\n- run configure script:\r\n\r\n`./configure --remote=pi@your_pi_host`\r\n- it should detect all needed information about the destination host. Now you can compile\r\n\r\n`make`\r\n- and install - this should install it into cross-environment; this is important for cross-compiling examples:\r\n\r\n`make install`\r\n- now you can upload/install to the remote machine:\r\n\r\n`make upload`\r\n- compile examples:\r\n\r\n` cd examples_linux`\r\n\r\n`make`\r\n- and upload them to the remote host:\r\n\r\n` make upload`\r\n\r\n\r\n- then you should have it ready at the remote machine.\r\n- you can cross-compile also without having remote machine available, then you have to set target SoC and driver:\r\n\r\n`./configure --soc=BCM2836 --driver=RPi`\r\n\r\n\r\n\r\n- python wrapper cross-compiling: it's a bit more difficult. It's not fully automatized and one needs to get python and libboost libs to cross-compiling environment. I got it in a simple way downloaded /usr and /lib directories from the target machine where both python and libboost are installed to a separate say rpi-root directory. Then it's needed to set path to that and to python headers:\r\n\r\n`export CFLAGS=\"--sysroot=rpi_root -Irpi_root/usr/include/python2.7/\"\r\n\r\n- then you can build the wrapper:\r\n\r\n` ./setup.py build --compiler=crossunix`\r\n\r\n- and make the egg package:\r\n\r\n`./setup.py bdist_egg --plat-name=cross`\r\n\r\n- then you get the .egg file. Upload it to the target machine and install there:\r\n\r\n`easy_install <your_egg.egg>`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/TMRh20/RF24/issues/comments/204536957","html_url":"https://github.com/TMRh20/RF24/issues/231#issuecomment-204536957","issue_url":"https://api.github.com/repos/TMRh20/RF24/issues/231","id":204536957,"user":{"login":"mz-fuzzy","id":9771301,"avatar_url":"https://avatars.githubusercontent.com/u/9771301?v=3","gravatar_id":"","url":"https://api.github.com/users/mz-fuzzy","html_url":"https://github.com/mz-fuzzy","followers_url":"https://api.github.com/users/mz-fuzzy/followers","following_url":"https://api.github.com/users/mz-fuzzy/following{/other_user}","gists_url":"https://api.github.com/users/mz-fuzzy/gists{/gist_id}","starred_url":"https://api.github.com/users/mz-fuzzy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mz-fuzzy/subscriptions","organizations_url":"https://api.github.com/users/mz-fuzzy/orgs","repos_url":"https://api.github.com/users/mz-fuzzy/repos","events_url":"https://api.github.com/users/mz-fuzzy/events{/privacy}","received_events_url":"https://api.github.com/users/mz-fuzzy/received_events","type":"User","site_admin":false},"created_at":"2016-04-01T19:32:16Z","updated_at":"2016-04-01T19:32:16Z","body":"@TMRh20 I've fixed the spidev issue in master. Can you see any other issue with makefile_improvements branch?"}}