comparison src/CMakeLists.txt @ 354:fde5f96c6ff1

use common perl script
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Fri, 12 Jun 2020 20:44:01 +0900
parents 6d96bba13d5d
children 650fac123133
comparison
equal deleted inserted replaced
353:c958c355f805 354:fde5f96c6ff1
69 if (${i} MATCHES "\\.cbc") 69 if (${i} MATCHES "\\.cbc")
70 string(REGEX REPLACE "(.*).cbc" "c/\\1.c" j ${i}) 70 string(REGEX REPLACE "(.*).cbc" "c/\\1.c" j ${i})
71 add_custom_command ( 71 add_custom_command (
72 OUTPUT ${CMAKE_KERNEL_DIR_C}/${j} 72 OUTPUT ${CMAKE_KERNEL_DIR_C}/${j}
73 DEPENDS ${i} 73 DEPENDS ${i}
74 COMMAND "cd" "${CMAKE_KERNEL_DIR_C}" ";" "perl" "${CMAKE_SOURCE_DIR}/gearsTools/generate_stub.pl" "-o" ${j} ${CMAKE_SOURCE_DIR}/${i} 74 COMMAND "cd" "${CMAKE_KERNEL_DIR_C}" ";" "perl" "${CMAKE_SOURCE_DIR}/gearsTools/generate_stub.pl" "--project" "xv6" "-o" ${j} ${CMAKE_SOURCE_DIR}/${i}
75 ) 75 )
76 list(APPEND _Gears_CBC_SOURCES "${CMAKE_KERNEL_DIR_C}/${j}") 76 list(APPEND _Gears_CBC_SOURCES "${CMAKE_KERNEL_DIR_C}/${j}")
77 #list(APPEND _Gears_CBC_SOURCES ${j}) 77 #list(APPEND _Gears_CBC_SOURCES ${j})
78 elseif (${i} MATCHES "\\.cu") 78 elseif (${i} MATCHES "\\.cu")
79 string(REGEX REPLACE "(.*).cu" "c/\\1.ptx" j ${i}) 79 string(REGEX REPLACE "(.*).cu" "c/\\1.ptx" j ${i})
98 file(COPY ${XV6_IMPL_HEADERS} DESTINATION ${CMAKE_KERNEL_DIR_C}) 98 file(COPY ${XV6_IMPL_HEADERS} DESTINATION ${CMAKE_KERNEL_DIR_C})
99 include_directories(${CMAKE_KERNEL_DIR_C}) 99 include_directories(${CMAKE_KERNEL_DIR_C})
100 add_custom_command ( 100 add_custom_command (
101 OUTPUT ${CMAKE_KERNEL_DIR_C}/c/${_Gears_TARGET}-context.c 101 OUTPUT ${CMAKE_KERNEL_DIR_C}/c/${_Gears_TARGET}-context.c
102 DEPENDS ${_Gears_CBC_SOURCES} fs.img initcode 102 DEPENDS ${_Gears_CBC_SOURCES} fs.img initcode
103 COMMAND "cd" "CMakeFiles/kernel.dir" ";" "perl" "${CMAKE_SOURCE_DIR}/gearsTools/generate_context.pl" "-o" ${_Gears_TARGET} "-w" ${_Gears_CBC_SOURCES} 103 COMMAND "cd" "CMakeFiles/kernel.dir" ";" "perl" "${CMAKE_SOURCE_DIR}/gearsTools/generate_context.pl" "--project" "xv6" "-o" ${_Gears_TARGET} "-w" ${_Gears_CBC_SOURCES}
104 ) 104 )
105 # add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} ${CMAKE_KERNEL_DIR}/c/${_Gears_TARGET}-context.c ) 105 # add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} ${CMAKE_KERNEL_DIR}/c/${_Gears_TARGET}-context.c )
106 file(COPY "${CMAKE_SOURCE_DIR}/device" DESTINATION "${CMAKE_KERNEL_DIR_C}") 106 file(COPY "${CMAKE_SOURCE_DIR}/device" DESTINATION "${CMAKE_KERNEL_DIR_C}")
107 add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} ${CMAKE_KERNEL_DIR_C}/c/${_Gears_TARGET}-context.c ) 107 add_executable(${_Gears_TARGET} ${_Gears_CBC_SOURCES} ${_Gears_CSOURCES} ${CMAKE_KERNEL_DIR_C}/c/${_Gears_TARGET}-context.c )
108 # target_link_libraries(${_Gears_TARGET} m pthread) 108 # target_link_libraries(${_Gears_TARGET} m pthread)