Skip to content

Commit

Permalink
build: namespace other generated headers
Browse files Browse the repository at this point in the history
Namespace the following generated headers into `zephyr/`
folder:

- app_version.h
- core-isa-dM.h
- cmake_intdef.h
- driver-validation.h
- kobj-types-enum.h
- linker-kobject-prebuilt-data.h
- mcuboot_version.h
- offsets.h
- otype-to-size.h
- otype-to-str.h
- syscall_list.h
- strerror_table.h
- strsignal_table.h
- zsr.h

Syscall headers will be done in another commit.

Signed-off-by: Yong Cong Sin <[email protected]>
  • Loading branch information
ycsin committed Oct 17, 2023
1 parent 6c95f1b commit d3efbb9
Show file tree
Hide file tree
Showing 72 changed files with 100 additions and 93 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -568,17 +568,19 @@ add_custom_target(version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/zeph

if(EXISTS ${APPLICATION_SOURCE_DIR}/VERSION)
add_custom_command(
OUTPUT ${PROJECT_BINARY_DIR}/include/generated/app_version.h
OUTPUT ${PROJECT_BINARY_DIR}/include/generated/zephyr/app_version.h
COMMAND ${CMAKE_COMMAND} -DZEPHYR_BASE=${ZEPHYR_BASE}
-DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/app_version.h
-DOUT_FILE=${PROJECT_BINARY_DIR}/include/generated/zephyr/app_version.h
-DVERSION_TYPE=APP
-DVERSION_FILE=${APPLICATION_SOURCE_DIR}/VERSION
-DAPP_VERSION_CUSTOMIZATION="${APP_VERSION_CUSTOMIZATION}"
${build_version_argument}
-P ${ZEPHYR_BASE}/cmake/gen_version_h.cmake
DEPENDS ${APPLICATION_SOURCE_DIR}/VERSION ${git_dependency}
)
add_custom_target(app_version_h DEPENDS ${PROJECT_BINARY_DIR}/include/generated/app_version.h)
add_custom_target(
app_version_h
DEPENDS ${PROJECT_BINARY_DIR}/include/generated/zephyr/app_version.h)
add_dependencies(zephyr_interface app_version_h)
endif()

Expand Down Expand Up @@ -631,7 +633,7 @@ set(ZEPHYR_CURRENT_CMAKE_DIR)
get_property(LIBC_LINK_LIBRARIES TARGET zephyr_interface PROPERTY LIBC_LINK_LIBRARIES)
zephyr_link_libraries(${LIBC_LINK_LIBRARIES})

set(syscall_list_h ${CMAKE_CURRENT_BINARY_DIR}/include/generated/syscall_list.h)
set(syscall_list_h ${CMAKE_CURRENT_BINARY_DIR}/include/generated/zephyr/syscall_list.h)
set(syscalls_json ${CMAKE_CURRENT_BINARY_DIR}/misc/generated/syscalls.json)
set(struct_tags_json ${CMAKE_CURRENT_BINARY_DIR}/misc/generated/struct_tags.json)

Expand Down Expand Up @@ -801,7 +803,7 @@ add_custom_command(OUTPUT include/generated/syscall_dispatch.c ${syscall_list_h}
# This is passed into all calls to the gen_kobject_list.py script.
set(gen_kobject_list_include_args --include-subsystem-list ${struct_tags_json})

set(DRV_VALIDATION ${PROJECT_BINARY_DIR}/include/generated/driver-validation.h)
set(DRV_VALIDATION ${PROJECT_BINARY_DIR}/include/generated/zephyr/driver-validation.h)
add_custom_command(
OUTPUT ${DRV_VALIDATION}
COMMAND
Expand Down Expand Up @@ -834,7 +836,7 @@ add_dependencies(zephyr_generated_headers
set(OFFSETS_LIB offsets)

set(OFFSETS_C_PATH ${ARCH_DIR}/${ARCH}/core/offsets/offsets.c)
set(OFFSETS_H_PATH ${PROJECT_BINARY_DIR}/include/generated/offsets.h)
set(OFFSETS_H_PATH ${PROJECT_BINARY_DIR}/include/generated/zephyr/offsets.h)

add_library( ${OFFSETS_LIB} OBJECT ${OFFSETS_C_PATH})
target_include_directories(${OFFSETS_LIB} PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion arch/arc/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_ARC_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_ARC_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

/* kernel */

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_ARM_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_ARM_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

/* kernel */

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/core/reset.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <zephyr/arch/cpu.h>
#include <offsets.h>
#include <zephyr/offsets.h>
#include "boot.h"
#include "macro_priv.inc"

Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/core/vector_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <offsets.h>
#include <zephyr/offsets.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/arch/arm64/tpidrro_el0.h>
#include <offsets_short.h>
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_ARM64_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_ARM64_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

#define _thread_offset_to_exception_depth \
(___thread_t_arch_OFFSET + ___thread_arch_t_exception_depth_OFFSET)
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#ifndef ZEPHYR_ARCH_MIPS_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_MIPS_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

#define _thread_offset_to_sp \
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_sp_OFFSET)
Expand Down
2 changes: 1 addition & 1 deletion arch/nios2/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_NIOS2_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_NIOS2_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

/* kernel */

Expand Down
2 changes: 1 addition & 1 deletion arch/posix/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_POSIX_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_POSIX_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

/* kernel */

Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/core/fpu.S
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <offsets.h>
#include <zephyr/offsets.h>

#ifdef CONFIG_CPU_HAS_FPU_DOUBLE_PRECISION
#define LOAD fld
Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/core/reset.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <zephyr/arch/cpu.h>
#include <offsets.h>
#include <zephyr/offsets.h>
#include "asm_macros.inc"

/* exports */
Expand Down
2 changes: 1 addition & 1 deletion arch/riscv/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_RISCV_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_RISCV_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

#define _thread_offset_to_sp \
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_sp_OFFSET)
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/include/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_SPARC_INCLUDE_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_SPARC_INCLUDE_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

#define _thread_offset_to_y \
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_y_OFFSET)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/ia32/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifndef ZEPHYR_ARCH_X86_INCLUDE_IA32_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_X86_INCLUDE_IA32_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

/* kernel */

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/include/intel64/offsets_short_arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifndef ZEPHYR_ARCH_X86_INCLUDE_INTEL64_OFFSETS_SHORT_ARCH_H_
#define ZEPHYR_ARCH_X86_INCLUDE_INTEL64_OFFSETS_SHORT_ARCH_H_

#include <offsets.h>
#include <zephyr/offsets.h>

#define _thread_offset_to_rsp \
(___thread_t_callee_saved_OFFSET + ___callee_saved_t_rsp_OFFSET)
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ add_subdirectory(startup)
# are the official places where we find core-isa.h. (Also that we
# undefine __XCC_ because that compiler actually trips an error trying
# to build this file to protect against mismatched versions.)
set(CORE_ISA_DM ${CMAKE_BINARY_DIR}/zephyr/include/generated/core-isa-dM.h)
set(CORE_ISA_DM ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/core-isa-dM.h)
set(CORE_ISA_IN ${CMAKE_BINARY_DIR}/zephyr/include/generated/core-isa-dM.c)
file(WRITE ${CORE_ISA_IN} "#include <xtensa/config/core-isa.h>\n")
add_custom_command(OUTPUT ${CORE_ISA_DM}
Expand All @@ -49,7 +49,7 @@ add_custom_command(OUTPUT ${CORE_ISA_DM}
${CORE_ISA_IN} -o ${CORE_ISA_DM})

# Generates a list of device-specific scratch register choices
set(ZSR_H ${CMAKE_BINARY_DIR}/zephyr/include/generated/zsr.h)
set(ZSR_H ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/zsr.h)
add_custom_command(OUTPUT ${ZSR_H} DEPENDS ${CORE_ISA_DM}
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/gen_zsr.py
${CORE_ISA_DM} ${ZSR_H})
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/core/coredump.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <string.h>
#include <zephyr/debug/coredump.h>
#include <xtensa-asm2.h>
#include <offsets.h>
#include <zephyr/offsets.h>

#define ARCH_HDR_VER 1
#define XTENSA_BLOCK_HDR_VER 2
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/core/debug_helpers_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <xtensa/hal.h>
#include <xtensa-asm2-context.h>

#include <offsets.h>
#include <zephyr/offsets.h>

.section .iram1, "ax"
.align 4
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/core/irq_offload.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <zephyr/kernel.h>
#include <zephyr/irq_offload.h>
#include <zsr.h>
#include <zephyr/zsr.h>
#include <zephyr/irq.h>

#define CURR_CPU (IS_ENABLED(CONFIG_SMP) ? arch_curr_cpu()->id : 0)
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/core/window_vectors.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <xtensa/coreasm.h>
#include <zsr.h>
#include <zephyr/zsr.h>

/* WINDOW OVERFLOW AND UNDERFLOW EXCEPTION VECTORS AND ALLOCA EXCEPTION
* HANDLER
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/core/xtensa-asm2-util.S
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <xtensa-asm2-s.h>
#include <offsets.h>
#include <zsr.h>
#include <zephyr/offsets.h>
#include <zephyr/zsr.h>

#if defined(CONFIG_SIMULATOR_XTENSA) || defined(XT_SIMULATOR)
#include <xtensa/simcall.h>
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/core/xtensa-asm2.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include <_soc_inthandlers.h>
#include <zephyr/toolchain.h>
#include <zephyr/logging/log.h>
#include <offsets.h>
#include <zsr.h>
#include <zephyr/offsets.h>
#include <zephyr/zsr.h>

LOG_MODULE_DECLARE(os, CONFIG_KERNEL_LOG_LEVEL);

Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/kernel_arch_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <kernel_internal.h>
#include <string.h>
#include <zephyr/cache.h>
#include <zsr.h>
#include <zephyr/zsr.h>

#ifdef __cplusplus
extern "C" {
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/include/xtensa-asm2-s.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
#ifndef ZEPHYR_ARCH_XTENSA_INCLUDE_XTENSA_ASM2_S_H
#define ZEPHYR_ARCH_XTENSA_INCLUDE_XTENSA_ASM2_S_H

#include <zsr.h>
#include <zephyr/zsr.h>
#include "xtensa-asm2-context.h"

#include <offsets.h>
#include <zephyr/offsets.h>

/* Assembler header! This file contains macros designed to be included
* only by the assembler.
Expand Down
2 changes: 1 addition & 1 deletion boards/x86/qemu_x86/qemu_x86_tiny.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include <zephyr/devicetree.h>
#include <offsets.h>
#include <zephyr/offsets.h>
#include <zephyr/linker/linker-defs.h>
#include <zephyr/linker/linker-tool.h>
#include <zephyr/sys/util.h>
Expand Down
12 changes: 6 additions & 6 deletions cmake/ide/eclipse_cdt4_generator_amendment.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# Solution:
# The amendment function generates a macro header file
# ${CMAKE_BINARY_DIR}/zephyr/include/generated/cmake_intdef.h
# ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/cmake_intdef.h
# based on INTERFACE_COMPILE_DEFINITIONS and appends the
# defines from the file to
# CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS.
Expand Down Expand Up @@ -46,7 +46,7 @@
# CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS.
#
#3. The amendment function appends the defines from
# ${CMAKE_BINARY_DIR}/zephyr/include/generated/autoconf.h to
# ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/autoconf.h to
# CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS.
#
function(eclipse_cdt4_generator_amendment _param_defs)
Expand Down Expand Up @@ -88,7 +88,7 @@ else(${_param_defs} EQUAL 1)
message(" ${_work_mode}")
endif(${_param_defs} EQUAL 1)

set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/zephyr/include/generated/cmake_intdef.h)
set(OUTPUT_FILE ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/cmake_intdef.h)
file(WRITE ${OUTPUT_FILE} "/* Generated by eclipse_cd4_generator_amendment.cmake */\n")
file(APPEND ${OUTPUT_FILE} "/* The header contains the defines collected from the */\n")
file(APPEND ${OUTPUT_FILE} "/* INTERFACE_COMPILE_DEFINITIONS target property */\n")
Expand All @@ -104,7 +104,7 @@ if (${_work_mode} STREQUAL "C and CXX includes, defines in Eclipse with project
message(" -------------------------------------------------------------------------")
message(" Add the following two command line parameters:")
message("")
message(" -imacros ${CMAKE_BINARY_DIR}/zephyr/include/generated/cmake_intdef.h")
message(" -imacros ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/cmake_intdef.h")
message(" -imacros ${AUTOCONF_H}")
message("")
message(" to 'CDT cross GCC Built-in Compiler Settings' provider command definition")
Expand All @@ -125,7 +125,7 @@ if ( (${_work_mode} STREQUAL "C and CXX includes, defines in .settings - [EXPERI
file(APPEND ${OUTPUT_FILE} "\t\t\t<provider-reference id=\"org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider\" ref=\"shared-provider\"/>\n")
file(APPEND ${OUTPUT_FILE} "\t\t\t<provider-reference id=\"org.eclipse.cdt.core.PathEntryScannerInfoLanguageSettingsProvider\" ref=\"shared-provider\"/>\n")
if (${_work_mode} STREQUAL "C and CXX includes, defines in .settings with project defines - [EXPERIMENTAL]")
file(APPEND ${OUTPUT_FILE} "\t\t\t<provider class=\"org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector\" console=\"false\" id=\"org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector\" keep-relative-paths=\"false\" name=\"Zephyr autoconf and SDK Compiler Settings\" parameter=\"${CROSS_COMPILE}\${COMMAND} \${FLAGS} -imacros ${CMAKE_BINARY_DIR}/zephyr/include/generated/cmake_intdef.h -imacros ${AUTOCONF_H} -E -P -v -dD &quot;\${INPUTS}&quot;\" store-entries-with-project=\"true\">\n")
file(APPEND ${OUTPUT_FILE} "\t\t\t<provider class=\"org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector\" console=\"false\" id=\"org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector\" keep-relative-paths=\"false\" name=\"Zephyr autoconf and SDK Compiler Settings\" parameter=\"${CROSS_COMPILE}\${COMMAND} \${FLAGS} -imacros ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/cmake_intdef.h -imacros ${AUTOCONF_H} -E -P -v -dD &quot;\${INPUTS}&quot;\" store-entries-with-project=\"true\">\n")
else ()
file(APPEND ${OUTPUT_FILE} "\t\t\t<provider class=\"org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector\" console=\"false\" id=\"org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector\" keep-relative-paths=\"false\" name=\"Zephyr autoconf and SDK Compiler Settings\" parameter=\"${CROSS_COMPILE}\${COMMAND} \${FLAGS} -E -P -v -dD &quot;\${INPUTS}&quot;\" store-entries-with-project=\"true\">\n")
endif ()
Expand Down Expand Up @@ -167,7 +167,7 @@ if ( (${_work_mode} STREQUAL "C and CXX includes, defines in .cproject without _

endif()

file(STRINGS ${CMAKE_BINARY_DIR}/zephyr/include/generated/cmake_intdef.h _int_comp_def)
file(STRINGS ${CMAKE_BINARY_DIR}/zephyr/include/generated/zephyr/cmake_intdef.h _int_comp_def)
set (_resultDefines "${CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS}")
foreach( d ${_int_comp_def} )
string(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*) *(.*) *$" _dummy "${d}")
Expand Down
4 changes: 2 additions & 2 deletions cmake/kobj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

function(gen_kobj gen_dir_out)
if (PROJECT_BINARY_DIR)
set(gen_dir ${PROJECT_BINARY_DIR}/include/generated)
set(gen_dir ${PROJECT_BINARY_DIR}/include/generated/zephyr)
else ()
set(gen_dir ${CMAKE_BINARY_DIR}/include/generated)
set(gen_dir ${CMAKE_BINARY_DIR}/include/generated/zephyr)
endif ()

set(KOBJ_TYPES ${gen_dir}/kobj-types-enum.h)
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/generated_file_directories.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ include_guard(GLOBAL)
# Optional environment variables:
# None

set(BINARY_DIR_INCLUDE ${PROJECT_BINARY_DIR}/include/generated)
set(BINARY_DIR_INCLUDE_GENERATED ${PROJECT_BINARY_DIR}/include/generated)
set(BINARY_DIR_INCLUDE ${PROJECT_BINARY_DIR}/include/generated/zephyr)
set(BINARY_DIR_INCLUDE_GENERATED ${PROJECT_BINARY_DIR}/include/generated/zephyr)
file(MAKE_DIRECTORY ${BINARY_DIR_INCLUDE_GENERATED})
5 changes: 3 additions & 2 deletions cmake/modules/kconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ include_guard(GLOBAL)
include(extensions)
include(python)

# autoconf.h is generated by Kconfig and placed in <build>/zephyr/include/generated/autoconf.h.
# autoconf.h is generated by Kconfig and placed in
# <build>/zephyr/include/generated/zephyr/autoconf.h.
# A project may request a custom location by setting AUTOCONF_H explicitly before
# calling 'find_package(Zephyr)' or loading this module.
set_ifndef(AUTOCONF_H ${PROJECT_BINARY_DIR}/include/generated/autoconf.h)
set_ifndef(AUTOCONF_H ${PROJECT_BINARY_DIR}/include/generated/zephyr/autoconf.h)
# Re-configure (Re-execute all CMakeLists.txt code) when autoconf.h changes
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${AUTOCONF_H})

Expand Down
2 changes: 1 addition & 1 deletion doc/build/cmake/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Devicetree

The preprocessed devicetree sources are parsed by
:zephyr_file:`gen_defines.py <scripts/dts/gen_defines.py>` to generate a
:file:`build/zephyr/include/generated/devicetree_generated.h` header with
:file:`build/zephyr/include/generated/zephyr/devicetree_generated.h` header with
preprocessor macros.

Source code should access preprocessor macros generated from devicetree by
Expand Down
2 changes: 1 addition & 1 deletion doc/build/dts/howtos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CMake prints the input and output file locations like this:
-- Found BOARD.dts: .../zephyr/boards/arm/qemu_cortex_m3/qemu_cortex_m3.dts
-- Generated zephyr.dts: .../zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_generated.h: .../zephyr/build/zephyr/include/generated/devicetree_generated.h
-- Generated devicetree_generated.h: .../zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h
The :file:`zephyr.dts` file is the final devicetree in DTS format.

Expand Down
2 changes: 1 addition & 1 deletion doc/build/dts/intro-input-output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ These are created in your application's build directory.
input to :file:`gen_defines.py` and used to create :file:`zephyr.dts` and
:file:`devicetree_generated.h`.

:file:`<build>/zephyr/include/generated/devicetree_generated.h`
:file:`<build>/zephyr/include/generated/zephyr/devicetree_generated.h`
The generated macros and additional comments describing the devicetree.
Included by ``devicetree.h``.

Expand Down
Loading

0 comments on commit d3efbb9

Please sign in to comment.