mindboards / ev3sources

LEGO MINDSTORMS EV3 source code
http://botbench.com/blog/2013/07/31/lego-mindstorms-ev3-source-code-available/
446 stars 178 forks source link

Build system and cleanup, see Issue #8 #13

Closed schodet closed 11 years ago

schodet commented 11 years ago

Here is a first step toward a regular build system.

It includes Makefiles for:

If you run make in open_first, it will present a list of available targets.

The build system will automatically build dependencies (for example, c_ui library is needed to build lms2012, and images need to be converted to .xbm to build c_ui).

Not done yet: images and SD cards.

I removed many generated files.

I have also made the connection with eclipse. There is a single project which run make with the selected target. As the workspace is no longer included, you have to import the project in a workspace, using this simple steps:

eclipse1_select_workspace eclipse2a_welcome eclipse3_import eclipse4_import_project eclipse5_import_project_root eclipse6_done

tcwan commented 11 years ago

Before this pull request is committed, the current repository should probably be tagged first.

tcwan commented 11 years ago

As the workspace is no longer included, you have to import the project in a workspace, using this simple steps:

Would it be ok to clone it to a local directory and just import it in Eclipse without specifying the git repository as the workspace? i.e., Workspace directory is separate from the ev3sources directory.

schodet commented 11 years ago

@tcwan: tags can be made at any time, at any hash, so order is not important.

I suppose it's OK for the separated workspace. I do not know eclipse well enough.

tcwan commented 11 years ago

@schodet:

I suppose it's OK for the separated workspace. I do not know eclipse well enough.

That is my default setup. I keep my repositories separate from my Eclipse workspace. I just wanted to check if there was any special circumstances for your example configuration.

sheabunge commented 11 years ago

Does anyone have any objections to merging this pull request?

tcwan commented 11 years ago

It looks ok to me, but please tag the existing repository as well, since all the binaries will be removed, people might want to be able to access the pre-built binaries (via the tagged version) until their setup can rebuild everything correctly.

I don't have a working setup to rebuild everything yet on my end.

schodet commented 11 years ago

I would like to add the instructions for eclipse somewhere, maybe in README.md?

tcwan commented 11 years ago

bungeshea mentioned that we should come up with a proper Wiki but I don't know when/who'll be getting that setup.

sheabunge commented 11 years ago

@tcwan what do you suggest the tag be called?

@schodet Probably best if you add your instructions to a wiki page and link to it from the readme.

@tcwan The wiki is avaliable here: https://github.com/mindboards/ev3sources/wiki Anyone with a GitHub account can edit the wiki. The only thing missing is some established content, but feel free to add some of your own.

botbench commented 11 years ago

I have some content that would be very wiki-able, I was going to make it into a blog article, but the wiki would be better

tcwan commented 11 years ago

@bungeshea: I'm not very inventive when it comes to tags. What about EV3_CODE_DUMP ?

botbench commented 11 years ago

EV3_PRE_BUILDSYSTEM_REVAMP :)

botbench commented 11 years ago

I am currently testing your build system @schodet :)

botbench commented 11 years ago

make kernel produces the following exit message: UIMAGE arch/arm/boot/uImage "mkimage" command not found - U-Boot images will not be built Image arch/arm/boot/uImage is ready make[1]: Leaving directory `/home/ev3builder/ev3sources/extra/linux-03.20.00.13' cp ../../extra/linux-03.20.00.13/arch/arm/boot/uImage uImage cp: cannot stat ‘../../extra/linux-03.20.00.13/arch/arm/boot/uImage’: No such file or directory make: *\ [uImage] Error 1

Is this expected? This was done with a clean tree, just after a checkout.

botbench commented 11 years ago

make lms2012 produces the following errors (again, a clean tree) arm-none-linux-gnueabi-gcc -DPCASM -I../../lms2012/source -I../../c_com/source -I../../c_input/source -I../../c_memory/source -I../../c_output/source -I../../c_sound/source -I../../c_ui/source -I../../../extra/linux-devkit/arm-none-linux-gnueabi/usr/include/dbus-1.0 -I../../../extra/linux-devkit/arm-none-linux-gnueabi/usr/lib/dbus-1.0/include -I../../../extra/linux-devkit/arm-none-linux-gnueabi/usr/include -O0 -Wall -fPIC -c -MMD -MP -o validate.o ../source/validate.c make[1]: * No rule to make target -lusb-1.0', needed bylms2012'. Stop. make[1]: Leaving directory `/home/ev3builder/ev3sources/lms2012/lms2012/Linux_AM1808' make: * [lms2012] Error 2

botbench commented 11 years ago

make programs (with clean tree), produces the following error: cp "Bluetooth/Bluetooth.rbf" "../../lms2012/Linux_AM1808/tools/Bluetooth/Bluetooth.rbf" convert "144x48_POP2.bmp" bitmap.xbm /bin/sh: 1: convert: not found make[2]: * [Bluetooth/144x48_POP2.rgf] Error 127 make[2]: Leaving directory `/home/ev3builder/ev3sources/lms2012/lmssrc/Bluetooth' make[1]: * [Bluetooth.install] Error 2 make[1]: Leaving directory`/home/ev3builder/ev3sources/lms2012/lmssrc' make: *\ [programs] Error 2

What is this convert program? If it's a new build requirement, maybe add it to the README, if it's not already there.

botbench commented 11 years ago

To compile the lms2012 target, the following packages need to be present (Ubuntu 13.04):

botbench commented 11 years ago

To get the /usr/bin/convert program, you need to have installed the imagemagick package.

botbench commented 11 years ago

All issues are resolved now with the installation of u-boot-tools, all targets apart from "programs" compile fine. Do you know where this is coming from? cp "Brick Datalog.raf" "../../lms2012/Linux_AM1808/apps/Brick Datalog.raf" cp: cannot create regular file ‘../../lms2012/Linux_AM1808/apps/Brick Datalog.raf’: No such file or directory make[2]: * [../../lms2012/Linux_AM1808/apps/Brick Datalog.raf] Error 1 make[2]: Leaving directory `/home/ev3builder/ev3sources/lms2012/lmssrc/Brick Datalog' make[1]: * [Brick+Datalog.install] Error 2 make[1]: Leaving directory`/home/ev3builder/ev3sources/lms2012/lmssrc' make: *\ [programs] Error 2

The path seems wrong, I can find the file here: ev3builder@ubuntu:~/ev3sources/lms2012/open_first$ find ../../ -name "Brick Datalog.raf" ../../lms2012/lmssrc/Brick Datalog/Brick Datalog.raf

schodet commented 11 years ago

@botbench:

For kernel, you need the u-boot-tools package. This is documented in the LEGO doc, however I can add a test in the Makefiles to give directions to the user as I have done for the cross compiler.

For -lusb, I think it should not be required to install it unless you are compiling for X86, I think I can fix that.

For convert, I can also add an hint about the package to install.

I will update the pull request with that.

botbench commented 11 years ago

@schodet , the work you've done is incredible, btw, thank you very much!

schodet commented 11 years ago

@botbench thank you! ;)

About the Brick Datalog.raf file, this is a missing mkdir for the destination directory, I will fix that!

schodet commented 11 years ago

I have pushed the fixes, and added a page to the wiki. Thanks for testing!

sheabunge commented 11 years ago

I have created the tag. Is this ready to merge?

botbench commented 11 years ago

I'll test it and let you know

botbench commented 11 years ago

ok, all targets are working as advertised. @bungeshea, let 'er rip, I say :) To you the honours of merging this request.