2013-07-06 20:38:11 +00:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2013-02-07 00:11:32 +00:00
|
|
|
|
|
|
|
|
2013-07-14 02:25:29 +00:00
|
|
|
# add_custom_command(
|
|
|
|
# OUTPUT lexer.cpp
|
|
|
|
# COMMAND re2c -b -i -o lexer.cpp "${CMAKE_CURRENT_SOURCE_DIR}/lexer.re.cpp"
|
|
|
|
# MAIN_DEPENDENCY lexer.re.cpp
|
|
|
|
# DEPENDS debugger.h parser.h
|
|
|
|
# )
|
|
|
|
|
2013-07-06 20:38:11 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT lexer.cpp
|
2013-07-14 02:25:29 +00:00
|
|
|
COMMAND ragel -p -G2 -o lexer.cpp "${CMAKE_CURRENT_SOURCE_DIR}/lexer.rl"
|
|
|
|
MAIN_DEPENDENCY lexer.rl
|
2013-07-06 20:38:11 +00:00
|
|
|
)
|
|
|
|
|
2015-01-06 01:28:56 +00:00
|
|
|
add_custom_command(
|
2013-07-06 20:38:11 +00:00
|
|
|
OUTPUT parser.cpp parser.h
|
|
|
|
COMMAND cp -f "${CMAKE_CURRENT_SOURCE_DIR}/parser.lemon" "parser.lemon"
|
|
|
|
COMMAND lemon parser.lemon
|
|
|
|
COMMAND cp -f parser.h "${CMAKE_CURRENT_SOURCE_DIR}/"
|
|
|
|
COMMAND cp -f parser.out "${CMAKE_CURRENT_SOURCE_DIR}/"
|
|
|
|
COMMAND mv -f parser.c parser.cpp
|
|
|
|
MAIN_DEPENDENCY parser.lemon
|
|
|
|
DEPENDS debugger.h
|
|
|
|
)
|
|
|
|
|
2015-01-06 01:28:56 +00:00
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT template_parser.cpp template_parser.h
|
|
|
|
COMMAND cp -f "${CMAKE_CURRENT_SOURCE_DIR}/template_parser.lemon" "template_parser.lemon"
|
|
|
|
COMMAND lemon template_parser.lemon
|
|
|
|
COMMAND cp -f template_parser.h "${CMAKE_CURRENT_SOURCE_DIR}/"
|
|
|
|
COMMAND cp -f template_parser.out "${CMAKE_CURRENT_SOURCE_DIR}/"
|
|
|
|
COMMAND mv -f template_parser.c template_parser.cpp
|
|
|
|
MAIN_DEPENDENCY template_parser.lemon
|
|
|
|
DEPENDS debugger.h
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
2013-07-08 03:39:53 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT loadtrap.cpp
|
|
|
|
COMMAND ragel -p -G2 -o loadtrap.cpp "${CMAKE_CURRENT_SOURCE_DIR}/loadtrap.rl"
|
|
|
|
MAIN_DEPENDENCY loadtrap.rl
|
|
|
|
DEPENDS debugger.h
|
|
|
|
)
|
2013-07-06 20:38:11 +00:00
|
|
|
|
2013-07-14 19:17:00 +00:00
|
|
|
|
2015-01-06 01:28:56 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT template_loader.cpp
|
|
|
|
COMMAND ragel -p -G2 -o template_loader.cpp "${CMAKE_CURRENT_SOURCE_DIR}/template_loader.rl"
|
|
|
|
MAIN_DEPENDENCY template_loader.rl
|
|
|
|
DEPENDS debugger.h template_parser.h
|
|
|
|
)
|
|
|
|
|
2015-06-23 14:11:47 +00:00
|
|
|
|
2015-01-06 01:28:56 +00:00
|
|
|
|
2013-07-14 19:17:00 +00:00
|
|
|
set_source_files_properties(
|
2015-01-06 01:28:56 +00:00
|
|
|
loadtrap.cpp lexer.cpp template_loader.cpp
|
2013-07-14 19:17:00 +00:00
|
|
|
PROPERTIES
|
2015-01-06 01:28:56 +00:00
|
|
|
COMPILE_FLAGS
|
2013-07-14 19:17:00 +00:00
|
|
|
"${CMAKE_CXX_FLAGS} -Wno-unused-variable"
|
|
|
|
)
|
|
|
|
|
2015-01-06 01:28:56 +00:00
|
|
|
|
2016-11-06 18:48:53 +00:00
|
|
|
#
|
|
|
|
# -ledit includes history stuff. gnu -lreadline does not.
|
|
|
|
#
|
|
|
|
|
|
|
|
IF (ENABLE_DEBUGGER)
|
|
|
|
set(DEBUGGER_SRC
|
|
|
|
debugger.cpp debugger.cpp debugger_internal.cpp
|
|
|
|
address_map.cpp lexer.cpp parser.cpp loadtrap.cpp
|
|
|
|
commands.cpp
|
|
|
|
template_loader.cpp template_parser.cpp intern.cpp template.cpp
|
|
|
|
)
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
add_executable(mpw main.cpp loadtrap.cpp ${DEBUGGER_SRC})
|
|
|
|
|
|
|
|
IF (ENABLE_DEBUGGER)
|
|
|
|
|
|
|
|
if(HAVE_LIBEDIT)
|
|
|
|
target_link_libraries(mpw edit)
|
|
|
|
elseif(HAVE_LIBREADLINE)
|
|
|
|
target_link_libraries(mpw readline)
|
|
|
|
if (HAVE_LIBHISTORY)
|
|
|
|
target_link_libraries(mpw history)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
ENDIF()
|
2014-12-30 19:09:07 +00:00
|
|
|
|
2013-02-07 00:11:32 +00:00
|
|
|
target_link_libraries(mpw CPU_LIB)
|
2013-02-07 04:44:12 +00:00
|
|
|
target_link_libraries(mpw TOOLBOX_LIB)
|
2013-02-11 01:19:53 +00:00
|
|
|
target_link_libraries(mpw MPW_LIB)
|
2013-02-08 03:49:20 +00:00
|
|
|
target_link_libraries(mpw MPLITE_LIB)
|
2016-07-31 17:23:44 +00:00
|
|
|
target_link_libraries(mpw NATIVE_LIB)
|
2013-03-04 03:17:27 +00:00
|
|
|
target_link_libraries(mpw MACOS_LIB)
|
2016-08-09 12:14:39 +00:00
|
|
|
target_link_libraries(mpw CXX_LIB)
|
2016-11-06 18:48:53 +00:00
|
|
|
|
2013-02-10 01:06:03 +00:00
|
|
|
|
|
|
|
|
2016-08-02 21:12:15 +00:00
|
|
|
#add_executable(disasm disasm.cpp)
|
|
|
|
#target_link_libraries(disasm CPU_LIB)
|
|
|
|
#target_link_libraries(disasm MACOS_LIB)
|
2015-06-23 14:11:47 +00:00
|
|
|
|
2016-02-07 02:31:05 +00:00
|
|
|
install(
|
|
|
|
PROGRAMS
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/mpw
|
|
|
|
DESTINATION bin
|
|
|
|
)
|