Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMSIS Build makefile, with GCC, always rebuilds library #971

Closed
bscarlet opened this issue Jul 23, 2020 · 2 comments
Closed

CMSIS Build makefile, with GCC, always rebuilds library #971

bscarlet opened this issue Jul 23, 2020 · 2 comments
Assignees
Labels
bug Build Issues regarding CMSIS-Build

Comments

@bscarlet
Copy link

For a cprj/target/output of type="lib", the generated makefile creates a makefile target named $(TARGET).lib, even though the rule for that target picks up the definition of AR_FLAGS from the toolchain-specific makefile, which - for gcc - creates lib$(TARGET).a instead.

As a result, when make is invoked to bring the library up to date, it cannot see the timestamp on lib$(TARGET).a and so understand that no work is necessary. Instead, it thinks it's looking for $(TARGET).lib, and because that file is never present it always re-runs the rule.

In my case, this means everything downstream in a larger build also gets rebuilt - i.e. the problem cascades.

I suggest that the generated makefile use the actual name of the library for the target.

If in the GCC .mak file there were
library_name:=lib$(1).a
and in the ARMCC .mak files there were
library_name:=$(1).lib

then the generated makefile could contain $(OBJ_DIR)/$(call library_name,$(TARGET)) where it currently contains $(OBJ_DIR)/$(TARGET).lib

and I think that would fix the problem.

@JonatanAntoni JonatanAntoni added Build Issues regarding CMSIS-Build review labels Jul 24, 2020
@brondani
Copy link
Collaborator

Hi Benjamin, thanks for reporting this issue.
Your proposed solution is also valid - it would just need backspaces' removal in order to support paths with (escaped) whitespaces.
We intend to release an updated beta version by mid of August, I will keep you posted!

@brondani brondani added bug and removed review labels Jul 24, 2020
@jkrech
Copy link
Collaborator

jkrech commented Oct 2, 2020

@jkrech jkrech closed this as completed Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Build Issues regarding CMSIS-Build
Projects
None yet
Development

No branches or pull requests

4 participants