Skip to content

Makefile cleanup#471

Merged
OlegHahm merged 19 commits intoRIOT-OS:masterfrom
OlegHahm:makefile_cleanup
Jan 7, 2014
Merged

Makefile cleanup#471
OlegHahm merged 19 commits intoRIOT-OS:masterfrom
OlegHahm:makefile_cleanup

Conversation

@OlegHahm
Copy link
Copy Markdown
Member

Makefile.include Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a subfolder for boards would be good if you want to build for multiple boards without a whole cleanup

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if you have boards with different architectures (e.g. native and arm) you'll end up with mixed binaries in RIOT/bin as they won't be rebuilt.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we envision to have the same board with different MCUs?

Otherwise, I like the idea. This was the way we did it in µkleos.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the BINDIR was where the project is built...

If that is the case:
What I meant is when building a project for different boards (say native and msba2) it leads to different architectures (native and arm) being built. In that case, if BINDIR is not dependent on the board/cpu, only modules would be built for the second board that were not built for the first board.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, if I fully understand your point. Just for clarification:

Current state (before this PR) is that architecture dependent files exist in RIOT/bin, projects/$(PROJECT)/bin and boards/bin. Thus, building the same project for another architecture or building another project for the same architecture almost always require a make clean before.

After this PR every binary goes into projects/$(RPOJECT)/bin - still requiring to call make clean before building the same project for a different architecture, but allowing to build different projects (for the same or a different architecture) without cleaning in between.

What we could do additionally would be to make a subfolder in projects/$(RPOJECT)/bin (e.g. projects/$(RPOJECT)/bin/msba2) containing all .o, .d and .a files and only putting the elf and hex file directly into bin, prefixed with the board, e.g. projects/$(RPOJECT)/bin/msba2-hello_world.hex.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think board subdirectories would be nice.

@OlegHahm
Copy link
Copy Markdown
Member Author

Would also fix #419 and #305

@ghost ghost assigned miri64 Dec 24, 2013
@mehlis
Copy link
Copy Markdown
Contributor

mehlis commented Dec 25, 2013

👍 for $PROJECT/bin/$BOARD/$PROJECTNAME.hex

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Jan 3, 2014

Addressed comments from @mehlis, @authmillenon and @LudwigOrtmann by creating an according subdirectory for the binaries and adding a variable to switch the compiler output on or off.

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Jan 5, 2014

Will squash, when acked.

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Jan 5, 2014

Just rebased - last 8 commits are new since last comments.

@LudwigKnuepfer
Copy link
Copy Markdown
Member

make buildtest for the default project does not show changes =)

Before:

Building for msba2 .. success
Building for wsn430-v1_3b .. success
Building for olimex_lpc2148 .. failed
Building for msb-430h .. success
Building for chronos .. success
Building for msb-430 .. success
Building for pttu .. failed
Building for mbed_lpc1768 .. failed
Building for native .. success
Building for telosb .. success
Building for redbee-econotag .. success
Building for wsn430-v1_4 .. success
Building for avsextrem .. success

After:

Building for msba2 .. success
Building for wsn430-v1_3b .. success
Building for olimex_lpc2148 .. failed
Building for msb-430h .. success
Building for chronos .. success
Building for msb-430 .. success
Building for pttu .. failed
Building for mbed_lpc1768 .. failed
Building for native .. success
Building for telosb .. success
Building for redbee-econotag .. success
Building for wsn430-v1_4 .. success
Building for avsextrem .. success

@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Jan 7, 2014

Is this an ACK?

@mehlis
Copy link
Copy Markdown
Contributor

mehlis commented Jan 7, 2014

ACK (building for native and msba2 is working)

@LudwigKnuepfer
Copy link
Copy Markdown
Member

I can't really review this (I've looked around more or less superficially and wasn't troubled), so I'd say its a NotNACK...

OlegHahm added a commit that referenced this pull request Jan 7, 2014
@OlegHahm OlegHahm merged commit b7c209e into RIOT-OS:master Jan 7, 2014
@OlegHahm OlegHahm deleted the makefile_cleanup branch January 7, 2014 14:29
@OlegHahm
Copy link
Copy Markdown
Member Author

OlegHahm commented Jan 7, 2014

Ooops, I was too quick and forgot squashing. Sorry. Will provide a cake at the next developer meeting.

@kaspar030
Copy link
Copy Markdown
Contributor

No need to squash the cake.

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.

Set the correct include path in modules' Makefiles

5 participants