Skip to content
Snippets Groups Projects
Commit 7c85e6e0 authored by Gaëtan Harter's avatar Gaëtan Harter
Browse files

Makefile.base: fix AR keeping removed source files objects

AR incrementally adds file without removing files.
If a c file is deleted or disabled(submodule removal) it is not removed from
archive and still ends up in the final elf file.

This fix removes the need to do 'make clean' for this case.

However it will break cases where an APPLICATION and a MODULE or two modules
have the same name and only worked because source files names where different.
parent b378bd4e
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,9 @@ $(BINDIR)/$(MODULE)/:
$(BINDIR)/$(MODULE).a $(OBJ): | $(BINDIR)/$(MODULE)/
$(BINDIR)/$(MODULE).a: $(OBJ) | ${DIRS:%=ALL--%}
$(Q)$(AR) $(ARFLAGS) $@ $?
@# Recreate archive to cleanup deleted/non selected source files objects
$(Q)$(RM) $@
$(Q)$(AR) $(ARFLAGS) $@ $^
CXXFLAGS = $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS)
CCASFLAGS = $(filter-out $(CCASUWFLAGS), $(CFLAGS)) $(CCASEXFLAGS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment