From 0900e5dc6c5afc88b4b37542911fb4ce22e425b9 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Wed, 26 Jul 2023 15:54:04 -0400 Subject: [PATCH] Fix #2415, use correct object extension in table build Do not assume ".o" for object files, use ${CMAKE_C_OUTPUT_EXTENSION} --- cmake/arch_build.cmake | 1 + cmake/tables/elf2cfetbl_rules.mk | 2 +- cmake/tables/generate_elf_table_rules.cmake | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/arch_build.cmake b/cmake/arch_build.cmake index a120dd8b3..04c44d97a 100644 --- a/cmake/arch_build.cmake +++ b/cmake/arch_build.cmake @@ -312,6 +312,7 @@ function(add_cfe_tables TABLE_FQNAME TBL_DEFAULT_SRC_FILES) -DOUTPUT_FILE="${TABLE_RULEFILE}" -DTABLE_NAME="${TABLE_BASENAME}" -DSOURCES="${TBL_SRC}" + -DOBJEXT="${CMAKE_C_OUTPUT_EXTENSION}" -P "${TABLE_GENSCRIPT}" WORKING_DIRECTORY ${WORKING_DIRECTORY} diff --git a/cmake/tables/elf2cfetbl_rules.mk b/cmake/tables/elf2cfetbl_rules.mk index fa36a6bf0..21e63e84d 100644 --- a/cmake/tables/elf2cfetbl_rules.mk +++ b/cmake/tables/elf2cfetbl_rules.mk @@ -1,5 +1,5 @@ # Rule for traditional CFE table generation via elf2cfetbl -elf/%.o: +elf/%: @mkdir -pv $(dir $(@)) cd $(dir $(@)) && $(AR) x $(abspath $(<)) $(notdir $(@)) diff --git a/cmake/tables/generate_elf_table_rules.cmake b/cmake/tables/generate_elf_table_rules.cmake index 35068e060..12da18bc7 100644 --- a/cmake/tables/generate_elf_table_rules.cmake +++ b/cmake/tables/generate_elf_table_rules.cmake @@ -22,7 +22,7 @@ set(TABLE_RULES) foreach(TBL_SRC ${SOURCES}) get_filename_component(DEP_FILE ${TBL_SRC} NAME) - set(DEP_FILE "${TMP_DIR}/${DEP_FILE}.o") + set(DEP_FILE "${TMP_DIR}/${DEP_FILE}${OBJEXT}") string(APPEND TABLE_RULES "${DEP_FILE}: ${ARCHIVE_FILE}\n" "${TABLE_BINARY}: ${DEP_FILE}\n"