diff --git a/CMakeLists.txt b/CMakeLists.txt index 6df0707a2..205b4830f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,9 +160,17 @@ install( # /usr/share/meevax/meevax-config-version.cmake FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) +# ---- TARGET uninstall -------------------------------------------------------- + +add_custom_target(uninstall + COMMAND sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} + COMMAND sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} + COMMAND sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}* + COMMAND sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}) + # ---- TARGET package ---------------------------------------------------------- -if(CMAKE_SYSTEM_NAME STREQUAL "Linux") +if(CMAKE_SYSTEM_NAME STREQUAL Linux) set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Tatsuya Yamasaki") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) @@ -176,35 +184,34 @@ endif() enable_testing() -if(CMAKE_SYSTEM_NAME STREQUAL Linux) - find_program(${PROJECT_NAME}_MEMORY_CHECK_COMMAND valgrind) - set(${PROJECT_NAME}_MEMORY_CHECK ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND} --error-exitcode=1 --leak-check=full --quiet --show-leak-kinds=all) +find_program(${PROJECT_NAME}_VALGRIND valgrind) + +if(${PROJECT_NAME}_VALGRIND STREQUAL ${PROJECT_NAME}_VALGRIND-NOTFOUND) + set(${PROJECT_NAME}_TEST "") else() - set(${PROJECT_NAME}_MEMORY_CHECK "") + set(${PROJECT_NAME}_TEST ${${PROJECT_NAME}_VALGRIND} --error-exitcode=1 --leak-check=full --quiet --show-leak-kinds=all) endif() -file(GLOB ${PROJECT_NAME}_TEST_SS ${CMAKE_CURRENT_SOURCE_DIR}/test/*.ss) - -foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_SS) - get_filename_component(FILENAME ${EACH} NAME_WE) - add_test(NAME ${FILENAME} COMMAND ${${PROJECT_NAME}_MEMORY_CHECK} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax ${EACH}) -endforeach() - file(GLOB ${PROJECT_NAME}_TEST_CPP ${CMAKE_CURRENT_SOURCE_DIR}/test/*.cpp) +file(GLOB ${PROJECT_NAME}_TEST_SH ${CMAKE_CURRENT_SOURCE_DIR}/test/*.sh) +file(GLOB ${PROJECT_NAME}_TEST_SS ${CMAKE_CURRENT_SOURCE_DIR}/test/*.ss) foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_CPP) get_filename_component(FILENAME ${EACH} NAME_WE) add_executable(test_${FILENAME} ${EACH}) target_link_libraries(test_${FILENAME} PRIVATE basis kernel) target_compile_options(test_${FILENAME} PUBLIC -Wno-deprecated-declarations) - add_test(NAME test/${FILENAME} COMMAND ${${PROJECT_NAME}_MEMORY_CHECK} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_${FILENAME}) + add_test(NAME test/${FILENAME} COMMAND ${${PROJECT_NAME}_TEST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_${FILENAME}) endforeach() -file(GLOB ${PROJECT_NAME}_TEST_SH ${CMAKE_CURRENT_SOURCE_DIR}/test/*.sh) - foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_SH) get_filename_component(FILENAME ${EACH} NAME_WE) - add_test(NAME ${FILENAME} COMMAND ${${PROJECT_NAME}_MEMORY_CHECK} ${EACH} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax) + add_test(NAME ${FILENAME} COMMAND ${${PROJECT_NAME}_TEST} ${EACH} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax) +endforeach() + +foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_SS) + get_filename_component(FILENAME ${EACH} NAME_WE) + add_test(NAME ${FILENAME} COMMAND ${${PROJECT_NAME}_TEST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax ${EACH}) endforeach() # ---- TARGET continuous-integration ------------------------------------------- diff --git a/README.md b/README.md index e9a8dfcb6..f4fcb8a5d 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,6 @@ library is installed as a CMake package for [easy linking](./example/CMakeLists.txt), and [any C++ classes can be used from Lisp-1 scripts](./example/example.ss) [via simple stubs](example/example.cpp). -### Releases - -Latest release is [here](https://github.com/yamacir-kit/meevax/releases). - ### Features - Traditional SECD machine [[2](#Landin-1964)]. @@ -84,48 +80,28 @@ Procedures for each standard are provided by the following R7RS-style libraries: - [GNU Binutils](https://www.gnu.org/software/binutils/) - [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/) -### Install +### Releases -``` bash -cmake -B build -DCMAKE_BUILD_TYPE=Release -cd build -make package -sudo apt install build/meevax_0.5.273_amd64.deb -``` +Latest release is [here](https://github.com/yamacir-kit/meevax/releases). -or +### Instruction + +First, generate a Makefile using CMake with the following command: ``` bash cmake -B build -DCMAKE_BUILD_TYPE=Release cd build -make install -``` - -### Uninstall - -If you installed with `sudo apt install`, - -``` bash -sudo apt remove meevax -``` - -or if you installed with `make install`, - -``` bash -sudo rm -rf /usr/local/bin/meevax -sudo rm -rf /usr/local/include/meevax -sudo rm -rf /usr/local/lib/libmeevax* -sudo rm -rf /usr/local/share/meevax ``` -### CMake targets +Then, select one of the following targets and `make` it according to your purpose. In most cases, `make install` will be the one you choose. -| Target Name | Description +| Target | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.0.5.273.so` and executable `meevax` -| `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_0.5.273_amd64.deb` -| `install` | Copy files into `/usr/local` directly +| `all` | Build shared-library `libmeevax.0.5.274.so` and executable `meevax`. +| `install` | Copy files into `/usr/local` directly. +| `package` | Generate debian package `meevax_0.5.274_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/meevax_0.5.274_amd64.deb`. +| `test` | Test executable `meevax`. This target requires Valgrind to be installed. +| `uninstall` | Remove files copied to `/usr/local` directly by target `install`. ## Usage diff --git a/VERSION b/VERSION index 33d01ba17..cd6210b2b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.5.273 +0.5.274 diff --git a/configure/README.md b/configure/README.md index 0e5e51df4..4db468264 100644 --- a/configure/README.md +++ b/configure/README.md @@ -15,10 +15,6 @@ library is installed as a CMake package for [easy linking](./example/CMakeLists.txt), and [any C++ classes can be used from Lisp-1 scripts](./example/example.ss) [via simple stubs](example/example.cpp). -### Releases - -Latest release is [here](https://github.com/yamacir-kit/meevax/releases). - ### Features - Traditional SECD machine [[2](#Landin-1964)]. @@ -84,48 +80,28 @@ Procedures for each standard are provided by the following R7RS-style libraries: - [GNU Binutils](https://www.gnu.org/software/binutils/) - [GNU Multiple Precision Arithmetic Library (GMP)](https://gmplib.org/) -### Install +### Releases -``` bash -cmake -B build -DCMAKE_BUILD_TYPE=Release -cd build -make package -sudo apt install build/${PROJECT_NAME}_${PROJECT_VERSION}_amd64.deb -``` +Latest release is [here](https://github.com/yamacir-kit/meevax/releases). -or +### Instruction + +First, generate a Makefile using CMake with the following command: ``` bash cmake -B build -DCMAKE_BUILD_TYPE=Release cd build -make install -``` - -### Uninstall - -If you installed with `sudo apt install`, - -``` bash -sudo apt remove meevax -``` - -or if you installed with `make install`, - -``` bash -sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME} -sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} -sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME}* -sudo rm -rf ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME} ``` -### CMake targets +Then, select one of the following targets and `make` it according to your purpose. In most cases, `make install` will be the one you choose. -| Target Name | Description +| Target | Description |-------------|------------- -| `all` | Build shared-library `libmeevax.${PROJECT_VERSION}.so` and executable `meevax` -| `test` | Test executable `meevax` -| `package` | Generate debian package `meevax_${PROJECT_VERSION}_amd64.deb` -| `install` | Copy files into `${CMAKE_INSTALL_PREFIX}` directly +| `all` | Build shared-library `libmeevax.${PROJECT_VERSION}.so` and executable `meevax`. +| `install` | Copy files into `${CMAKE_INSTALL_PREFIX}` directly. +| `package` | Generate debian package `meevax_${PROJECT_VERSION}_amd64.deb` (only Ubuntu). The generated package can be installed by `sudo apt install build/${PROJECT_NAME}_${PROJECT_VERSION}_amd64.deb`. +| `test` | Test executable `meevax`. This target requires Valgrind to be installed. +| `uninstall` | Remove files copied to `${CMAKE_INSTALL_PREFIX}` directly by target `install`. ## Usage diff --git a/include/meevax/memory/integer_set.hpp b/include/meevax/memory/integer_set.hpp index ded82d60d..125803f6d 100644 --- a/include/meevax/memory/integer_set.hpp +++ b/include/meevax/memory/integer_set.hpp @@ -54,7 +54,7 @@ namespace meevax::inline memory { using value_type = T; - using difference_type = std::ptrdiff_t; + using difference_type = std::ptrdiff_t; using pointer = T *; @@ -136,7 +136,7 @@ namespace meevax::inline memory auto operator ++() noexcept -> auto & { - if (++iter; not iter) + if (not ++iter) { ++i; increment_unless_truthy(); @@ -151,7 +151,7 @@ namespace meevax::inline memory { decrement_unless_truthy(); } - else if (--iter; not iter) + else if (not --iter) { --i; decrement_unless_truthy(); @@ -318,7 +318,7 @@ namespace meevax::inline memory { using value_type = T; - using difference_type = std::ptrdiff_t; + using difference_type = std::ptrdiff_t; using pointer = T *; diff --git a/script/repl.sh b/script/repl.sh deleted file mode 100755 index e902e5bae..000000000 --- a/script/repl.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -e - - -export RLWRAP_EDITOR='vim -c "set filetype=scheme"' - -rlwrap --break-chars "(){}[].,;#@|'\`\"" \ - --complete-filenames \ - --multi-line \ - --quote-characters "\"" \ - meevax -i "$@" diff --git a/script/setup-ubuntu-20.04.sh b/script/setup-ubuntu-20.04.sh deleted file mode 120000 index 3a2605f79..000000000 --- a/script/setup-ubuntu-20.04.sh +++ /dev/null @@ -1 +0,0 @@ -setup-ubuntu.sh \ No newline at end of file