1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #7952 from cladmi/pr/ar_delete_old_files

Makefile.base: fix AR keeping removed source files objects
This commit is contained in:
Francisco Acosta 2018-03-14 19:28:35 +01:00 committed by GitHub
commit 3af570bd57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -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)

View File

@ -34,6 +34,20 @@ current configuration or not.
Modules can be used by adding their name to the `USEMODULE` macro of your
application's Makefile.
### Pitfalls ###
The `MODULE` name should be unique or build breaks as modules overwrite the
same output file.
This problem happened in the past for:
* Packages root directory (libfixmath/u8g2)
* boards/cpu/periph and their common boards/cpu/periph
Note: even if all boards and cpus implement the `board` and `cpu` modules, only
one is used in an application so there is no conflict.
Module dependencies
===================
Your module may depend on other modules to minimize code duplication. These