1if (CONFIG_HAS_ALTERA_HAL)
2  #nios2 core/system level headers
3  zephyr_include_directories(
4    include
5    altera_hal/HAL/inc
6    )
7
8  zephyr_compile_definitions(ZEPHYR_RTOS)
9  add_subdirectory(altera_hal/HAL/src)
10
11  if(CONFIG_ALTERA_AVALON_TIMER)
12    zephyr_include_directories(
13      drivers/altera_avalon_timer/inc
14      drivers/altera_avalon_timer/HAL/inc
15      )
16    add_subdirectory(drivers/altera_avalon_timer/HAL/src)
17  endif()
18
19  if(CONFIG_ALTERA_AVALON_SYSID)
20    zephyr_include_directories(
21      drivers/altera_avalon_sysid/inc
22      drivers/altera_avalon_sysid/HAL/inc
23      )
24    add_subdirectory(drivers/altera_avalon_sysid/HAL/src)
25  endif()
26
27  if(CONFIG_UART_ALTERA_JTAG)
28    zephyr_compile_definitions(ALTERA_AVALON_JTAG_UART_SMALL)
29    zephyr_include_directories(
30      drivers/altera_avalon_jtag_uart/inc
31      drivers/altera_avalon_jtag_uart/HAL/inc
32      drivers/altera_avalon_jtag_uart/LWHAL/inc
33      )
34    add_subdirectory(
35      drivers/altera_avalon_jtag_uart/HAL/src
36      drivers/altera_avalon_jtag_uart/LWHAL/src
37      )
38  endif()
39
40  if(CONFIG_ALTERA_AVALON_MSGDMA)
41    zephyr_include_directories(
42      drivers/altera_msgdma/inc
43      drivers/altera_msgdma/HAL/inc
44      )
45    add_subdirectory(drivers/altera_msgdma/HAL/src)
46  endif()
47
48  if(CONFIG_ALTERA_AVALON_I2C)
49    zephyr_include_directories(
50      drivers/altera_avalon_i2c/inc
51      drivers/altera_avalon_i2c/HAL/inc
52      )
53    add_subdirectory(drivers/altera_avalon_i2c/HAL/src)
54  endif()
55
56  if(CONFIG_ALTERA_AVALON_QSPI)
57    zephyr_include_directories(
58      drivers/altera_generic_qspi_controller2/inc
59      drivers/altera_generic_qspi_controller2/HAL/inc
60      )
61  endif()
62endif()
63