cmake: x86: Add wrapper targets for custom commands

In general, to have correct dependencies, one must not only depend on
files, but also a wrapper target for the file. This is done for some
of the files in arch/x86/CMakeLists.txt, but not all.

To be consistent with how dependency management is done we add wrapper
targets and add dependencies to them.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2019-02-12 16:25:20 +01:00 committed by Andrew Boie
commit 00b2e54b1c

View file

@ -153,6 +153,12 @@ if(CONFIG_X86_MMU)
DEPENDS ${ZEPHYR_PREBUILT_EXECUTABLE}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_target(
mmu_tables_bin_target
DEPENDS
mmu_tables.bin
)
add_custom_command(
OUTPUT mmu_tables.bin user_mmu_tables.bin
COMMAND
@ -179,6 +185,7 @@ if(CONFIG_X86_MMU)
mmu_tables.o
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS mmu_tables.bin
mmu_tables_bin_target
)
add_custom_target( mmu_tables_o DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/mmu_tables.o)
@ -216,6 +223,11 @@ if(CONFIG_GDT_DYNAMIC)
# way.
#
# ${ZEPHYR_PREBUILT_EXECUTABLE}.elf -> gdt.bin -> gdt.o
add_custom_target(
gdt_bin_target
DEPENDS
gdt.bin
)
add_custom_command(
OUTPUT gdt.bin
COMMAND
@ -239,6 +251,7 @@ if(CONFIG_GDT_DYNAMIC)
gdt.o
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS gdt.bin
gdt_bin_target
)
add_custom_target( gdt_o DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/gdt.o)