Closed simonhf closed 1 year ago
Note: Some of the $(sort ...)
additions have already been made to the Nano X SDK Makefile.rules
[1] but not the Nano S SDK equivalent [2].
[1] https://github.com/LedgerHQ/nanox-secure-sdk/blob/master/Makefile.rules [2] https://github.com/LedgerHQ/nanos-secure-sdk/blob/master/Makefile.rules
Hello @simonhf , sorry for the very late answer, I think that this issue is not relevant anymore with the new app builder docker that is OXS compatible. I'll close the issue, feel free to reach out if you are not satisfied with the answer
When trying to build an app for the Ledger Nano S on OSX I found a build /
Makefile
issue and managed to track it down to the way the command line toolfind
works differently on OSX than on Linux.On OSX this
Makefile
line [1] assigningVPATH
ends up with duplicated folders which are spelt slightly differently. This causesmake
to run differently and not create the.d
files and ultimately themake
fails because of this.The problem is introduced on this
Makefile
line [2] which relies onfind
.Example of the problem manifesting itself with simple command line
find
examples:On Linux then an example
find
looks like this, which is also what is expected:On OSX then an example
find
looks like this, which is unexpected, and also introduces the issue that identical paths are spelt differently, e.g. :./src//common/
and./src/common//
which ultimately causesmake
to fail (see above).Why does this happen with
find
on OSX? According to this [3] it's just how things are withfind
on OSX :-(However, a fix / workaround is to strip out any
//
e.g. as follows:The fix in
Makefile.rules
file which worked for me is:Note: I also sprinkled added
sort
around too in order to remove unnecessary duplicates [4] which make debugging harder. Unfortunatelysort
is unable to remove "duplicates" like this:./src//common/
and./src/common//
.If you'd like then I can put together a PR if necessary.
Looking forward to comments and feedback :-)
[1] https://github.com/LedgerHQ/nanos-secure-sdk/blob/master/Makefile.rules#L34 [2] https://github.com/LedgerHQ/nanos-secure-sdk/blob/master/Makefile.rules#L31 [3] https://discussions.apple.com/thread/3565773 [4] https://stackoverflow.com/questions/16144115/makefile-remove-duplicate-words-without-sorting