diff --git a/CMakeLists.txt b/CMakeLists.txt index f1143ea24..fcebcdac9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ cmake_minimum_required(VERSION 3.16.3) # Ubuntu 20.04 LTS default execute_process( - COMMAND head -c -1 ${CMAKE_CURRENT_SOURCE_DIR}/VERSION + COMMAND cat ${CMAKE_CURRENT_SOURCE_DIR}/VERSION + COMMAND tr -d "\n" OUTPUT_VARIABLE CURRENT_VERSION) project(meevax DESCRIPTION "A programmable programming language" @@ -43,28 +44,31 @@ else() set(${PROJECT_NAME}_BYTE_ORDER "little-endian") endif() +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --digit-value OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DIGIT_VALUE) +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --downcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DOWNCASE) +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --property OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_PROPERTY) +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --upcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_UPCASE) + execute_process( COMMAND head -c -1 ${CMAKE_CURRENT_SOURCE_DIR}/configure/help.txt OUTPUT_VARIABLE ${PROJECT_NAME}_HELP) +file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/digit_value.hpp "${${PROJECT_NAME}_UNICODE_DIGIT_VALUE}") +file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/downcase.hpp "${${PROJECT_NAME}_UNICODE_DOWNCASE}") +file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/property.hpp "${${PROJECT_NAME}_UNICODE_PROPERTY}") +file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/upcase.hpp "${${PROJECT_NAME}_UNICODE_UPCASE}") + string(TOLOWER ${CMAKE_SYSTEM_NAME} ${PROJECT_NAME}_SYSTEM_NAME) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/README.md ${CMAKE_CURRENT_SOURCE_DIR}/README.md) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/kernel/version.cpp) -# ---- Target unicode ---------------------------------------------------------- - -add_custom_target(unicode - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/configure/UnicodeData.cmake) - # ---- Target kernel ----------------------------------------------------------- add_library(kernel SHARED) add_library(${PROJECT_NAME}::kernel ALIAS kernel) -add_dependencies(kernel unicode) - file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp) target_sources(kernel PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES}) @@ -76,11 +80,10 @@ target_include_directories(kernel PUBLIC target_link_libraries(kernel PRIVATE ${CMAKE_DL_LIBS} PUBLIC gmp) -set_target_properties(kernel PROPERTIES - OUTPUT_NAME ${PROJECT_NAME} # Rename libkernel => libmeevax - VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR} - LINK_FLAGS_RELEASE -s) +set_target_properties(kernel PROPERTIES OUTPUT_NAME ${PROJECT_NAME} # Rename libkernel => libmeevax + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} + LINK_FLAGS_RELEASE -s) # ---- Target format ----------------------------------------------------------- @@ -94,7 +97,7 @@ target_link_libraries(format PRIVATE kernel) add_custom_target(basis DEPENDS format - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.cmake) + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/basis/configure.cmake) # ---- Target shell ------------------------------------------------------------ @@ -106,9 +109,8 @@ target_sources(shell PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp) target_link_libraries(shell PRIVATE kernel) -set_target_properties(shell PROPERTIES - OUTPUT_NAME ${PROJECT_NAME} # Rename shell => meevax - LINK_FLAGS_RELEASE -s) +set_target_properties(shell PROPERTIES OUTPUT_NAME ${PROJECT_NAME} # Rename shell => meevax + LINK_FLAGS_RELEASE -s) # ---- CMake Package ----------------------------------------------------------- diff --git a/README.md b/README.md index 36b4100cf..ba8f129fc 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ Subset of R7RS-small. cmake -B build -DCMAKE_BUILD_TYPE=Release cd build make package -sudo apt install build/meevax_0.4.819_amd64.deb +sudo apt install build/meevax_0.4.818_amd64.deb ``` or @@ -106,9 +106,9 @@ sudo rm -rf /usr/local/share/meevax | Target Name | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.4.819.so` and executable `meevax` +| `all` | Build shared-library `libmeevax.0.4.818.so` and executable `meevax` | `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.4.819_amd64.deb` +| `package` | Generate debian package `meevax_0.4.818_amd64.deb` | `install` | Copy files into `/usr/local` directly ## Usage diff --git a/VERSION b/VERSION index 3ecb492b4..e0f4e0ff5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.819 +0.4.818 diff --git a/configure/basis.cmake b/basis/configure.cmake similarity index 100% rename from configure/basis.cmake rename to basis/configure.cmake diff --git a/configure/UnicodeData.cmake b/configure/UnicodeData.cmake deleted file mode 100644 index 007bc39ca..000000000 --- a/configure/UnicodeData.cmake +++ /dev/null @@ -1,14 +0,0 @@ -execute_process( - COMMAND git rev-parse --show-toplevel - COMMAND tr -d "\n" - OUTPUT_VARIABLE TOPLEVEL) - -execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --digit-value OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DIGIT_VALUE) -execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --downcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_DOWNCASE) -execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --property OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_PROPERTY) -execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/script/unicode.sh --upcase OUTPUT_VARIABLE ${PROJECT_NAME}_UNICODE_UPCASE) - -file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/digit_value.hpp "${${PROJECT_NAME}_UNICODE_DIGIT_VALUE}") -file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/downcase.hpp "${${PROJECT_NAME}_UNICODE_DOWNCASE}") -file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/property.hpp "${${PROJECT_NAME}_UNICODE_PROPERTY}") -file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}/unicode/upcase.hpp "${${PROJECT_NAME}_UNICODE_UPCASE}")