Added tag v0.15-rc4 for changeset 2a97f14b9016
[hvf.git] / cp / CMakeLists.txt
blob76c973ef0544fa575266bd0d8403f7a1a0596319
1 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVERSION=\\\"${HVF_VERSION}\\\"")
2 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I ${PROJECT_SOURCE_DIR}/cp/include/")
3 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -include ${PROJECT_SOURCE_DIR}/cp/include/nucleus.h")
5 set(CMAKE_EXE_LINKER_FLAGS "-T ${PROJECT_SOURCE_DIR}/cp/scripts/linker-hvf.script")
7 add_custom_command(
8         OUTPUT nucleus/config.tab.h
9                nucleus/config.tab.c
10         COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../build/byacc/yacc
11                 -b config -d -P -p config_ config.y
12         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/nucleus
13         DEPENDS nucleus/config.y
15 add_custom_command(
16         OUTPUT nucleus/config.lex.c
17         COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../build/re2c/re2c
18                 -o config.lex.c config.l
19         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/nucleus
20         DEPENDS nucleus/config.l nucleus/config.tab.h
23 add_custom_command(
24         OUTPUT nucleus/direct.tab.h
25                nucleus/direct.tab.c
26         COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../build/byacc/yacc
27                 -b direct -d -P -p direct_ direct.y
28         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/nucleus
29         DEPENDS nucleus/direct.y
31 add_custom_command(
32         OUTPUT nucleus/direct.lex.c
33         COMMAND ${CMAKE_CURRENT_BINARY_DIR}/../build/re2c/re2c
34                 -o direct.lex.c direct.l
35         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/nucleus
36         DEPENDS nucleus/direct.l nucleus/direct.tab.h
39 set(SUBDIRS nucleus mm fs drivers shell guest)
41 set(SRCFILES "")
42 foreach(SUBDIR ${SUBDIRS})
43         set(FILES "")
44         include(${SUBDIR}/objs.cmake)
45         foreach(FILE ${FILES})
46                 set(SRCFILES ${SRCFILES} ${SUBDIR}/${FILE})
47         endforeach()
48 endforeach()
50 add_executable(hvf ${SRCFILES})
52 target_link_libraries(hvf clock)
53 target_link_libraries(hvf digest)
54 target_link_libraries(hvf string)
55 target_link_libraries(hvf ebcdic)
56 target_link_libraries(hvf errno)