2013-02-06 04:41:11 +00:00
|
|
|
#set(CMAKE_C_COMPILER "clang")
|
|
|
|
#set(CMAKE_CXX_COMPILER "clang++")
|
2013-02-07 04:44:12 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -Wno-deprecated-declarations -g")
|
2013-02-06 04:41:11 +00:00
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "-framework Carbon")
|
2013-07-06 20:38:11 +00:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
2013-02-07 00:11:32 +00:00
|
|
|
|
|
|
|
add_definitions(-I ${CMAKE_SOURCE_DIR}/)
|
|
|
|
|
|
|
|
|
2013-07-06 20:38:11 +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
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
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
|
|
|
|
)
|
|
|
|
|
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-08 03:39:53 +00:00
|
|
|
add_executable(mpw loader.cpp debugger.cpp address_map.cpp lexer.cpp parser.cpp loadtrap.cpp)
|
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)
|
2013-03-04 03:17:27 +00:00
|
|
|
target_link_libraries(mpw MACOS_LIB)
|
2013-07-04 03:50:30 +00:00
|
|
|
set_target_properties(mpw PROPERTIES LINK_FLAGS "-ledit")
|
2013-02-10 01:06:03 +00:00
|
|
|
|
|
|
|
|
2013-03-04 03:17:27 +00:00
|
|
|
add_executable(disasm disasm.cpp)
|
2013-02-10 01:06:03 +00:00
|
|
|
target_link_libraries(disasm CPU_LIB)
|
2013-03-04 03:17:27 +00:00
|
|
|
target_link_libraries(disasm MACOS_LIB)
|