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

Fix #2423, avoid use of abspath make function #2424

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cmake/tables/elf2cfetbl_rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Rule for traditional CFE table generation via elf2cfetbl

# The dependency of this target should always be an absolute pathname to
# the intermediate library file as it is generated by a CMake script via
# the TARGET_FILE property. Therefore, the same path should still work
# after the "cd" command. The "cd" is so the ar tool writes the object file
# into a separate dir, in case of similarly-named files on different cpus.
elf/%:
@mkdir -pv $(dir $(@))
cd $(dir $(@)) && $(AR) x $(abspath $(<)) $(notdir $(@))
@mkdir -pv "$(dir $(@))"
cd "$(dir $(@))" && $(AR) x "$(<)" "$(notdir $(@))"
11 changes: 8 additions & 3 deletions cmake/tables/tabletool_rule.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
cfetables:
@echo "Table build completed"

#%.tbl: $(TBLTOOL)
# The dependency of this rule should always be a relative path starting with elf/,
# at least with the current rule generator script, so it matches the elf/% pattern rule.
# But because elf2cfetbl only writes its output to the current working dir, it has to be run
# after changing dirs into the staging area. Thus the path to the elf file needs to be adjusted.
# Ideally this chould be done with the $(abspath f...) function but this doesn't exist in older versions.
# As a workaround, $CURDIR is used.
staging/%.tbl:
@mkdir -pv $(dir $(@))
cd $(dir $(@)) && $(TBLTOOL) $(TBLTOOL_FLAGS) $(abspath $(^))
@mkdir -pv "$(dir $(@))"
cd "$(dir $(@))" && $(TBLTOOL) $(TBLTOOL_FLAGS) "$(CURDIR)/$(<)"
Loading