Variant library makefile problems

The official STMicroelectronics Arduino core
Post Reply
User avatar
RogerClark
Posts: 7183
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Variant library makefile problems

Post by RogerClark » Thu Sep 29, 2016 10:48 am

Guys

I'm not an expert in makefiles, but there are 2 problems

https://github.com/stm32duino/Arduino_C ... /build_gcc

1. make clean does not appear to work, it only seems to delete the library .a file and leaves all the object files in tact

2. The output of the make / compile is sent to /dev/nul on linux, and on windows they just sent it to "NUL". However on Windows, this just created a file called NUL, which was very hard to delete (you have to do it via a command window)
My temporary fix for the NUL issue is to use NUL.txt so at least its deletable, but from what I understand it should be possible to redirect to nul on widows, some way or another

Edit

LOoks like issue 1 is caused because they used "cs-rm" Mentor Sourcery CodeBench command line

I will probably just replace cs-rm -rf
with

rm -r *

edit looks like rm -Rf works for windows as well as Linux, so I"m not sure why Wi6Labs chose to use cs-rm

User avatar
Pito
Posts: 1600
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Variant library makefile problems

Post by Pito » Thu Sep 29, 2016 11:29 am

My experience is in windows you need "special" variants of make, mkdir, rm, cp etc to be happy.
There are various versions flying around, some will simply silently not do what you would expect :?
It took me a week to recognize that, as the makefile "worked", but some details inside were not executed properly.
Something like:

Code: Select all

-include $(shell mkdir .dep 2>/dev/null) $(wildcard .dep/*)
does work with a right toolset under windows.
Also, for example, an "mkdir -p" with a not good "mkdir" will create a new directory called "-p" for you happily :)
The "/" vs "\" in dir_paths - that is a nightmare in makefiles run under windows - it may ignore silently the directory..
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 7183
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Variant library makefile problems

Post by RogerClark » Thu Sep 29, 2016 8:55 pm

I think using powershell seems to compile OK after some changes to the makefile

But, I will email Wi6Labs to find out their windows build env.

And it needs to be documented in a Readme.md in the system folder and at the top level. I guess I should also add a Wiki to the stm32duino github account to hold this information

I dont know if Wi6Labs are still under contract to STM, but if they are, I will see if I can get them to write the docs

User avatar
Wi6Labs
Posts: 25
Joined: Fri Sep 16, 2016 11:39 am
Location: Rennes, France
Contact:

Re: Variant library makefile problems

Post by Wi6Labs » Mon Oct 03, 2016 12:54 pm

Roger,

The build process has been tested only under Linux OS. It explains why you have problems under Windows OS.
We don't guarantee the functionning of the library if it is generated under Windows.

We also take account your request about the documentation.
Wi6Labs team

User avatar
RogerClark
Posts: 7183
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Variant library makefile problems

Post by RogerClark » Mon Oct 03, 2016 8:36 pm

Build is working OK under windows, but I had to update the L4 makefile, as it did not contain the code to setup the path to the gcc toolchain.
So I copied this from your F1 makefile

You do have some references to building under windows including using codesoucery tools, but I will change this to work without those tools.


PS. i thought the document you emailed to be was confidential, and hence I could discuss its contents.

Post Reply