»Recursive variable ›TARGET_PATH‹« stops local compile

Hi. I am building locally.

I have used the hal (hardware abstraction layer) branch since last year, and have switched to “latest” branch today. My setup needs some changes now (e.g. installed new compiler version). My “app” resides next to the firmware folder, so I can version control my app separately. To compile for my Core, I have used this command until now (from my app directory):

cd ../firmware/main # switch to firmware folder
make PLATFORM=core APPDIR=../../myApp
cd ../../myApp

After the switch from hal to latest, the compiler is stopped by this mysterious message:

…/build/module-defaults.mk:95: *** Recursive variable `TARGET_PATH’ references itself (eventually). Stop.

Interestingly, when I move myApp to firmware/user/applications/myApp and build with…

make PLATFORM=core APP=myApp

… compilation works. Why?? And how can I continue making the firmware with an external app path?

Thank you very much.

You could soft link your application folder into the ‘firmware/user/applications’ folder.

ln -s myApp firmware/user/applications/myApp

I remember I had the same issue, cant test it right now but I believe I resolved it by also specifying a TARGET_DIR, somewhere outside the firmware folder.

Thats’s really strange. Yeah!

make PLATFORM=core APPDIR=../../myApp TARGET_DIR=zzz

… will make a zzz folder in main, along with 8 other “zzz”-prefixed files. Now it works. Quite bizarre. I really would like to know why this is.

Great! That’s an option. As I use the setup on several machines, I’d like to avoid hardcoding folder locations, though. See the other solution.

Thanks for reporting this. It’s a known issue and has been fixed in the develop branch. We will be releasing 0.4.5 with this fix early next week. :slight_smile:

1 Like

That is awesome! Thank you.
General questions: Is a random thread like this the right way to report bugs? If not, what is the best location to do so?

It’s good to have the initial discussion here, then we can see if it’s already a known issue. If it’s indeed a new bug, then we can go ahead and create a new github issue for it.

1 Like