mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-23 22:30:51 +00:00
clean up makefiles a bit.
This commit is contained in:
parent
60c4977dfa
commit
e21aac4022
@ -1,10 +1,22 @@
|
||||
set(CMAKE_C_COMPILER "clang")
|
||||
set(CMAKE_CXX_COMPILER "clang++")
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -g")
|
||||
set(CMAKE_C_FLAGS " -Wall -g")
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
project(mpw VERSION 0.8.1 LANGUAGES CXX C)
|
||||
|
||||
project(mpw)
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
set(CMAKE_CXX_EXTENSIONS FALSE)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
set(CMAKE_C_STANDARD_REQUIRED TRUE)
|
||||
set(CMAKE_C_EXTENSIONS FALSE)
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
# Clang or AppleClang
|
||||
set(CMAKE_CXX_FLAGS "-Wall")
|
||||
set(CMAKE_C_FLAGS "-Wall")
|
||||
endif()
|
||||
|
||||
|
||||
include_directories("${CMAKE_SOURCE_DIR}")
|
||||
|
||||
add_subdirectory(bin)
|
||||
add_subdirectory(cpu)
|
||||
|
@ -1,18 +1,11 @@
|
||||
#set(CMAKE_C_COMPILER "clang")
|
||||
#set(CMAKE_CXX_COMPILER "clang++")
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -Wno-deprecated-declarations -g")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "-framework Carbon")
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
add_definitions(-I ${CMAKE_SOURCE_DIR}/)
|
||||
|
||||
|
||||
# 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
|
||||
# )
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
# Clang or AppleClang
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations -Wno-unused-variable")
|
||||
endif()
|
||||
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT lexer.cpp
|
||||
@ -24,8 +17,6 @@ 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
|
||||
@ -36,8 +27,6 @@ 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
|
||||
@ -61,14 +50,6 @@ add_custom_command(
|
||||
)
|
||||
|
||||
|
||||
|
||||
set_source_files_properties(
|
||||
loadtrap.cpp lexer.cpp template_loader.cpp
|
||||
PROPERTIES
|
||||
COMPILE_FLAGS
|
||||
"${CMAKE_CXX_FLAGS} -Wno-unused-variable"
|
||||
)
|
||||
|
||||
add_executable(mpw loader.cpp debugger.cpp debugger_internal.cpp
|
||||
address_map.cpp lexer.cpp parser.cpp loadtrap.cpp
|
||||
commands.cpp
|
||||
@ -80,12 +61,14 @@ target_link_libraries(mpw TOOLBOX_LIB)
|
||||
target_link_libraries(mpw MPW_LIB)
|
||||
target_link_libraries(mpw MPLITE_LIB)
|
||||
target_link_libraries(mpw MACOS_LIB)
|
||||
set_target_properties(mpw PROPERTIES LINK_FLAGS "-ledit")
|
||||
|
||||
target_link_libraries(mpw -ledit)
|
||||
target_link_libraries(mpw "-framework Carbon")
|
||||
|
||||
add_executable(disasm disasm.cpp)
|
||||
target_link_libraries(disasm CPU_LIB)
|
||||
target_link_libraries(disasm MACOS_LIB)
|
||||
target_link_libraries(disasm "-framework Carbon")
|
||||
|
||||
install(
|
||||
PROGRAMS
|
||||
|
@ -1,6 +1,7 @@
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(CMAKE_C_FLAGS " -Wall -Wno-unused-function -g")
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
# Clang or AppleClang
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Wno-unused-function")
|
||||
endif()
|
||||
|
||||
set(CPU_SRC
|
||||
CpuModule.c
|
||||
|
@ -1,10 +1,3 @@
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -g")
|
||||
|
||||
add_definitions(-I ${CMAKE_SOURCE_DIR}/)
|
||||
|
||||
set(MACOS_SRC traps.c sysequ.c errors.cpp)
|
||||
|
||||
|
||||
add_library(MACOS_LIB ${MACOS_SRC})
|
@ -1,5 +1,3 @@
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(MPLITE_SRC mplite.c)
|
||||
|
||||
add_library(MPLITE_LIB ${MPLITE_SRC})
|
@ -1,17 +1,9 @@
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -g")
|
||||
|
||||
add_definitions(-I ${CMAKE_SOURCE_DIR}/)
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
set(MPW_SRC mpw.cpp mpw_io.cpp mpw_close.cpp mpw_access.cpp mpw_ioctl.cpp mpw_errno.cpp
|
||||
environment.cpp)
|
||||
|
||||
# add_custom_command(
|
||||
# OUTPUT environ.cpp
|
||||
# COMMAND ragel -p -G2 -o environ.cpp "${CMAKE_CURRENT_SOURCE_DIR}/environ.rl"
|
||||
# MAIN_DEPENDENCY environ.rl
|
||||
# )
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT environment.cpp
|
||||
@ -20,22 +12,6 @@ add_custom_command(
|
||||
)
|
||||
|
||||
|
||||
# add_custom_command(
|
||||
# OUTPUT epv.cpp
|
||||
# COMMAND ragel -p -G2 -o epv.cpp "${CMAKE_CURRENT_SOURCE_DIR}/epv.rl"
|
||||
# MAIN_DEPENDENCY epv.rl
|
||||
# )
|
||||
|
||||
|
||||
# add_custom_command(
|
||||
# OUTPUT ep.cpp
|
||||
# COMMAND ragel -p -G2 -o ep.cpp "${CMAKE_CURRENT_SOURCE_DIR}/ep.rl"
|
||||
# MAIN_DEPENDENCY ep.rl
|
||||
# )
|
||||
|
||||
|
||||
|
||||
|
||||
set_source_files_properties(
|
||||
environment.cpp # environ.cpp ep.cpp epv.cpp
|
||||
PROPERTIES
|
||||
|
@ -1,8 +1,10 @@
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11 -stdlib=libc++ -Wall -Wno-deprecated-declarations -g")
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
# Clang or AppleClang
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
|
||||
endif()
|
||||
|
||||
add_definitions(-I ${CMAKE_SOURCE_DIR}/)
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
|
||||
set(TOOLBOX_SRC
|
||||
toolbox.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user