Skip to content

Commit 5b05982

Browse files
committed
uVisor: Fix 'publish' and core libs dependencies
The 'TARGET_M%' rules depend on files generated by the 'rsync' target, so make this dependency explicit by setting 'rsync' as a pre-requisite of 'TARGET_M%'. The 'rsync' dependency was removed from 'publish' to avoid the case where make would select one of the 'TARGET' rules before completing 'rsync', which would cause the build to fail. Additionally, also moved the core libs selection in the 'TARGET_M%' pattern rule from the pre-requisites into the rule's recipe. This is required because when the wildcard expression used before as a pre-requisite is expanded (make's 1st phase), it won't find any files (not built yet via 'rsync' target), so it won't create the associated 'TARGET_M%' rules, finally causing the 'publish' target building to fail due to missing rules for 'TARGET_M3' and 'TARGET_M4'. With this change and the previous one, it is ensured that 'rsync' is done before executing the recipe for 'TARGET_M%', so the required core libs are already available and can be used from withing the recipe. The same wildcard pattern is used as before. The issues being fixed are visible with GNU Make 4.2.1, but not seen with GNU Make 3.81. Fixes issue #3905.
1 parent b272647 commit 5b05982

File tree

1 file changed

+5
-4
lines changed
  • features/FEATURE_UVISOR/importer

1 file changed

+5
-4
lines changed

features/FEATURE_UVISOR/importer/Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,13 @@ rsync:
8989
# Copying licenses
9090
cp $(UVISOR_DIR)/LICENSE* $(TARGET_SUPPORTED)
9191

92-
TARGET_M%: $(TARGET_SUPPORTED)/*/*/*_cortex_m%*.a
92+
TARGET_M%: TARGET_LIBS_FIND=$(wildcard $(TARGET_SUPPORTED)/*/*/*_cortex_m$(subst TARGET_M,,$@)*.a)
93+
TARGET_M%: rsync
9394
@printf "#\n# Copying $@ files...\n"
94-
mkdir $(foreach file,$^,$(dir $(file))$@)
95-
$(foreach file,$^,mv $(file) $(dir $(file))$@/lib$(notdir $(file));)
95+
mkdir $(foreach file,$(TARGET_LIBS_FIND),$(dir $(file))$@)
96+
$(foreach file,$(TARGET_LIBS_FIND),mv $(file) $(dir $(file))$@/lib$(notdir $(file));)
9697

97-
publish: rsync TARGET_M3 TARGET_M4
98+
publish: TARGET_M3 TARGET_M4
9899
#
99100
# Rename release directorires to TARGET_RELEASE filters...
100101
$(foreach dir, $(TARGET_LIST_RELEASE),mv $(dir) $(dir $(dir))TARGET_RELEASE;)

0 commit comments

Comments
 (0)