Reputation: 351
I am able to build firmware for all the branches of NodeMCU, https://github.com/nodemcu/nodemcu-firmware only when I clone them to separate local directories.
When I try to only have one folder and use git checkout branch I can only build the master firmware. When I checkout the branches the other files change to match the branch but I cannot build the firmware. Maybe this is just the way it is? I was hoping I could use git checkout master and then make to build the master firmware and then use git checkout dev and then make to build the dev firmware. The files do change to reflect the branch correctly so I'm not sure why it doesn't work.
Upvotes: 1
Views: 101
Reputation: 23565
While @VonC's answer is certainly helpful and somewhat "correct", it is also very generic.
What you are possibly struggling with are the Git submodules. We use them for e.g. u8g2 and ucg. Peek inside .gitmodules
in the respective branch for details.
When you switch branches you need to update the submodules. git worktree
would come very handy here but as there are still bugs which affect the handling of submodules I never tried.
I suspect you followed the instructions at https://nodemcu.readthedocs.io/en/master/build/#git. For the ESP32 branch we documented a few more build instructions as the cloud builder does not support it yet.
Conclusion: make sure to run git submodule update --recursive
every time you switch branches.
Upvotes: 2
Reputation: 1329860
First, you don't have to do multiple clone.
You can make just one clone, then checkout those branches in their respective folders with git worktree
.
Second, when you checkout a branch, additional files created during your first compilation would not be removed, which could interfer with your second compilation.
Do a git clean -n -d -x -f
to preview what you could clean from your newly checked out working tree.
Once you are sure, remove the -n
(dry-run option). Remove also -x
if you don't want to to remove the ignored files.
Upvotes: 2