Skip to content
Snippets Groups Projects
Unverified Commit beb2f0bf authored by Martine Lenders's avatar Martine Lenders Committed by GitHub
Browse files

Merge pull request #9479 from cgundogan/pr/make_USEMODULE_INCLUDES_dedup

make: dedup USEMODULE_INCLUDES w/o shelling out
parents e2ab6cf8 202e73dc
Branches
No related tags found
No related merge requests found
......@@ -327,7 +327,15 @@ $(info $(USEPKG:%=$(RIOTPKG)/%/Makefile.include))
.PHONY: $(USEPKG:%=$(RIOTPKG)/%/Makefile.include)
-include $(USEPKG:%=$(RIOTPKG)/%/Makefile.include)
USEMODULE_INCLUDES_ = $(shell echo $(USEMODULE_INCLUDES) | tr ' ' '\n' | awk '!a[$$0]++' | tr '\n' ' ')
# Deduplicate includes without sorting them
# see https://stackoverflow.com/questions/16144115/makefile-remove-duplicate-words-without-sorting
define uniq =
$(eval seen :=)
$(foreach _,$1,$(if $(filter $_,$(seen)),,$(eval seen += $_)))
$(seen)
endef
USEMODULE_INCLUDES_ = $(strip $(call uniq,$(USEMODULE_INCLUDES)))
INCLUDES += $(USEMODULE_INCLUDES_:%=-I%)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment