Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build system and cleanup, see Issue #8 #13

Merged
merged 27 commits into from
Aug 31, 2013

Conversation

schodet
Copy link
Contributor

@schodet schodet commented Aug 29, 2013

Here is a first step toward a regular build system.

It includes Makefiles for:

  • the lms2012 program and its libraries,
  • the d_* modules,
  • the programs in lmssrc and their generated data files,
  • documentations,
  • kernel,
  • u-Boot.

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
Copy link
Member

tcwan commented Aug 29, 2013

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

@tcwan
Copy link
Member

tcwan commented Aug 29, 2013

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
Copy link
Contributor Author

schodet commented Aug 29, 2013

@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
Copy link
Member

tcwan commented Aug 29, 2013

@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
Copy link
Member

Does anyone have any objections to merging this pull request?

@tcwan
Copy link
Member

tcwan commented Aug 30, 2013

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
Copy link
Contributor Author

schodet commented Aug 30, 2013

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

@tcwan
Copy link
Member

tcwan commented Aug 30, 2013

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

@sheabunge
Copy link
Member

@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
Copy link
Member

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
Copy link
Member

tcwan commented Aug 30, 2013

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

@botbench
Copy link
Member

EV3_PRE_BUILDSYSTEM_REVAMP :)

@botbench
Copy link
Member

I am currently testing your build system @schodet :)

@botbench
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

  • libdbus-1-dev
  • libusb-1.0-0-dev
  • libbluetooth-dev

@botbench
Copy link
Member

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

@botbench
Copy link
Member

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
Copy link
Contributor Author

schodet commented Aug 30, 2013

@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
Copy link
Member

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

@schodet
Copy link
Contributor Author

schodet commented Aug 30, 2013

@botbench thank you! ;)

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

Make will find system libraries for -lusb, -ldbus... That is not wanted.
Libraries are in linux-devkit directory.  Make could be pointed to
this directory, but as it is binary anyway, I do not really care.
Provide a hint to user if it is not installed.
Provide a hint to user if it is not installed.
@schodet
Copy link
Contributor Author

schodet commented Aug 31, 2013

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

@sheabunge
Copy link
Member

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

@botbench
Copy link
Member

I'll test it and let you know

@botbench
Copy link
Member

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

sheabunge added a commit that referenced this pull request Aug 31, 2013
Revamp build system and cleanup. Resolves #8
@sheabunge sheabunge merged commit 7357369 into mindboards:master Aug 31, 2013
@schodet schodet deleted the build-cleanup branch September 3, 2013 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants