Skip to content

Commit

Permalink
Merge pull request #466 from yamacir-kit/release-candidate
Browse files Browse the repository at this point in the history
Release candidate
  • Loading branch information
yamacir-kit authored Oct 25, 2023
2 parents fc2876f + 10f0155 commit 59f3b72
Show file tree
Hide file tree
Showing 45 changed files with 2,256 additions and 1,476 deletions.
117 changes: 57 additions & 60 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ execute_process(
COMMAND tr -d "\n"
OUTPUT_VARIABLE CURRENT_VERSION)

project(meevax DESCRIPTION "A programmable programming language"
HOMEPAGE_URL "https://github.com/yamacir-kit/meevax"
LANGUAGES CXX
VERSION ${CURRENT_VERSION})
project(meevax
DESCRIPTION "A programmable programming language"
HOMEPAGE_URL "https://github.com/yamacir-kit/meevax"
LANGUAGES CXX
VERSION ${CURRENT_VERSION})

include(GNUInstallDirs)

Expand All @@ -20,9 +21,9 @@ string(JOIN " " AGGRESSIVE_OPTIMIZATION_OPTIONS
)

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "-Og -gdwarf-4") # NOTE: The `-gdwarf-4` option is set due to the following issues with Clang 14 and Valgrind versions below 3.20: https://bugzilla.mozilla.org/show_bug.cgi?id=1758782
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${AGGRESSIVE_OPTIMIZATION_OPTIONS}")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -gdwarf-4") # NOTE: The `-gdwarf-4` option is set due to the following issues with Clang 14 and Valgrind versions below 3.20: https://bugzilla.mozilla.org/show_bug.cgi?id=1758782
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG ${AGGRESSIVE_OPTIMIZATION_OPTIONS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -gdwarf-4 -DNDEBUG")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -pipe")
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -67,36 +68,27 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure/version.cpp ${CMAKE_CURRENT

add_library(kernel SHARED)

add_library(${PROJECT_NAME}::kernel ALIAS kernel)

file(GLOB_RECURSE ${PROJECT_NAME}_KERNEL_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*/*.cpp)

target_sources(kernel PRIVATE ${${PROJECT_NAME}_KERNEL_SOURCES})

target_include_directories(kernel PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

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)

# ---- Target format -----------------------------------------------------------

add_executable(format)
target_include_directories(kernel
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)

target_sources(format PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/format.cpp)
target_link_libraries(kernel
PRIVATE ${CMAKE_DL_LIBS}
PUBLIC gmp)

target_link_libraries(format PRIVATE kernel)
set_target_properties(kernel PROPERTIES
OUTPUT_NAME ${PROJECT_NAME} # Rename libkernel => libmeevax
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
LINK_FLAGS_RELEASE -s)

# ---- Target basis ------------------------------------------------------------

add_custom_target(basis
DEPENDS format
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/configure/basis.cmake)

# ---- Target shell ------------------------------------------------------------
Expand All @@ -109,8 +101,9 @@ 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 -----------------------------------------------------------

Expand All @@ -122,29 +115,30 @@ write_basic_package_version_file(

# ---- Target install ----------------------------------------------------------

# /usr/lib/libmeevax
install(TARGETS kernel
EXPORT ${PROJECT_NAME}-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install( # /usr/lib/libmeevax
TARGETS kernel
EXPORT ${PROJECT_NAME}-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

# /usr/bin/meevax
install(TARGETS shell
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install( # /usr/bin/meevax
TARGETS shell
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

# /usr/include/meevax
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install( # /usr/include/meevax
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# /usr/share/meevax/meevax-config.cmake
install(EXPORT ${PROJECT_NAME}-config
EXPORT_LINK_INTERFACE_LIBRARIES
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}
NAMESPACE Meevax::)
install( # /usr/share/meevax/meevax-config.cmake
EXPORT ${PROJECT_NAME}-config
EXPORT_LINK_INTERFACE_LIBRARIES
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}
NAMESPACE Meevax::)

# /usr/share/meevax/meevax-config-version.cmake
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})

# ---- Target package ----------------------------------------------------------

Expand All @@ -164,20 +158,22 @@ enable_testing()

find_program(${PROJECT_NAME}_MEMORY_CHECK_COMMAND valgrind)

set(${PROJECT_NAME}_MEMORY_CHECK_COMMAND_OPTIONS --error-exitcode=1 # = EXIT_FAILURE)
--leak-check=full
--quiet
--show-leak-kinds=all)
set(${PROJECT_NAME}_MEMORY_CHECK_OPTIONS
--error-exitcode=1 # = EXIT_FAILURE)
--leak-check=full
--quiet
--show-leak-kinds=all)

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_COMMAND}
${${PROJECT_NAME}_MEMORY_CHECK_COMMAND_OPTIONS}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax
${EACH})
add_test(
NAME ${FILENAME}
COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND}
${${PROJECT_NAME}_MEMORY_CHECK_OPTIONS}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/meevax
${EACH})
endforeach()

file(GLOB ${PROJECT_NAME}_TEST_CPP ${CMAKE_CURRENT_SOURCE_DIR}/test/*.cpp)
Expand All @@ -187,10 +183,11 @@ foreach(EACH IN LISTS ${PROJECT_NAME}_TEST_CPP)
add_executable(assert-${FILENAME} ${EACH})
add_dependencies(assert-${FILENAME} basis)
target_link_libraries(assert-${FILENAME} PRIVATE kernel)
add_test(NAME assert-${FILENAME}
COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND}
${${PROJECT_NAME}_MEMORY_CHECK_COMMAND_OPTIONS}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/assert-${FILENAME})
add_test(
NAME assert-${FILENAME}
COMMAND ${${PROJECT_NAME}_MEMORY_CHECK_COMMAND}
${${PROJECT_NAME}_MEMORY_CHECK_OPTIONS}
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/assert-${FILENAME})
endforeach()

# ---- Additional Targets ------------------------------------------------------
Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,34 +46,34 @@ Procedures for each standard are provided by the following R7RS-style libraries:
|:--------:|--------------|
| R4RS | [`(scheme r4rs)`](./basis/r4rs.ss)
| R5RS | [`(scheme r5rs)`](./basis/r5rs.ss)
| R7RS | [`(scheme base)`](./basis/r7rs.ss) [`(scheme box)`](./basis/r7rs.ss) [`(scheme case-lambda)`](./basis/r7rs.ss) [`(scheme char)`](./basis/r7rs.ss) [`(scheme complex)`](./basis/r7rs.ss) [`(scheme cxr)`](./basis/r7rs.ss) [`(scheme eval)`](./basis/r7rs.ss) [`(scheme file)`](./basis/r7rs.ss) [`(scheme inexact)`](./basis/r7rs.ss) [`(scheme lazy)`](./basis/r7rs.ss) [`(scheme load)`](./basis/r7rs.ss) [`(scheme process-context)`](./basis/r7rs.ss) [`(scheme read)`](./basis/r7rs.ss) [`(scheme repl)`](./basis/r7rs.ss) [`(scheme time)`](./basis/r7rs.ss) [`(scheme write)`](./basis/r7rs.ss)
| R7RS | [`(scheme base)`](./basis/r7rs.ss) [`(scheme box)`](./basis/r7rs.ss) [`(scheme case-lambda)`](./basis/r7rs.ss) [`(scheme char)`](./basis/r7rs.ss) [`(scheme complex)`](./basis/r7rs.ss) [`(scheme cxr)`](./basis/r7rs.ss) [`(scheme eval)`](./basis/r7rs.ss) [`(scheme file)`](./basis/r7rs.ss) [`(scheme inexact)`](./basis/r7rs.ss) [`(scheme lazy)`](./basis/r7rs.ss) [`(scheme list)`](./basis/r7rs.ss) [`(scheme load)`](./basis/r7rs.ss) [`(scheme process-context)`](./basis/r7rs.ss) [`(scheme read)`](./basis/r7rs.ss) [`(scheme repl)`](./basis/r7rs.ss) [`(scheme time)`](./basis/r7rs.ss) [`(scheme write)`](./basis/r7rs.ss)

### SRFIs

| Number | Title | Library name | Note |
|--------------------------------------------------------:|--------------------------------------------------------|-------------------------------------|-----------------------------------|
| [ 0](https://srfi.schemers.org/srfi-0/srfi-0.html) | Feature-based conditional expansion construct | [`(srfi 0)`](./basis/srfi-0.ss) | R7RS 4.2.1 |
| [ 1](https://srfi.schemers.org/srfi-1/srfi-1.html) | List Library | [`(srfi 1)`](./basis/srfi-1.ss) | |
| [ 4](https://srfi.schemers.org/srfi-4/srfi-4.html) | Homogeneous numeric vector datatypes | [`(srfi 4)`](./basis/srfi-4.ss) | R7RS 6.9 |
| [ 6](https://srfi.schemers.org/srfi-6/srfi-6.html) | Basic String Ports | [`(srfi 6)`](./basis/srfi-6.ss) | R7RS 6.13 |
| [ 8](https://srfi.schemers.org/srfi-8/srfi-8.html) | receive: Binding to multiple values | [`(srfi 8)`](./basis/srfi-8.ss) | |
| [ 9](https://srfi.schemers.org/srfi-9/srfi-9.html) | Defining Record Types | [`(srfi 9)`](./basis/srfi-9.ss) | R7RS 5.5 |
| [ 10](https://srfi.schemers.org/srfi-10/srfi-10.html) | #, external form | | |
| [ 11](https://srfi.schemers.org/srfi-11/srfi-11.html) | Syntax for receiving multiple values | [`(srfi 11)`](./basis/srfi-11.ss) | R7RS 4.2.2 |
| [ 16](https://srfi.schemers.org/srfi-16/srfi-16.html) | Syntax for procedures of variable arity | [`(srfi 16)`](./basis/srfi-16.ss) | R7RS 4.2.9 |
| [ 23](https://srfi.schemers.org/srfi-23/srfi-23.html) | Error reporting mechanism | [`(srfi 23)`](./basis/srfi-23.ss) | R7RS 6.11 |
| [ 30](https://srfi.schemers.org/srfi-30/srfi-30.html) | Nested Multi-line Comments | | R7RS 2.2 |
| [ 31](https://srfi.schemers.org/srfi-31/srfi-31.html) | A special form rec for recursive evaluation | [`(srfi 31)`](./basis/srfi-31.ss) | |
| [ 34](https://srfi.schemers.org/srfi-34/srfi-34.html) | Exception Handling for Programs | [`(srfi 34)`](./basis/srfi-34.ss) | R7RS 6.11 |
| [ 38](https://srfi.schemers.org/srfi-38/srfi-38.html) | External Representation for Data With Shared Structure | [`(srfi 38)`](./basis/srfi-38.ss) | R7RS 6.13.3 |
| [ 39](https://srfi.schemers.org/srfi-39/srfi-39.html) | Parameter objects | [`(srfi 39)`](./basis/srfi-39.ss) | R7RS 4.2.6 |
| [ 45](https://srfi.schemers.org/srfi-45/srfi-45.html) | Primitives for Expressing Iterative Lazy Algorithms | [`(srfi 45)`](./basis/srfi-45.ss) | R7RS 4.2.5 |
| [ 62](https://srfi.schemers.org/srfi-62/srfi-62.html) | S-expression comments | | R7RS 2.2 |
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
| [ 98](https://srfi.schemers.org/srfi-98/srfi-98.html) | An interface to access environment variables | [`(srfi 98)`](./basis/srfi-98.ss) | R7RS 6.14 |
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | [`(scheme box)`](./basis/r7rs.ss) |
| [149](https://srfi.schemers.org/srfi-149/srfi-149.html) | Basic syntax-rules template extensions | [`(srfi 149)`](./basis/srfi-149.ss) | R7RS 4.3.2 |
| Number | Title | Library name | Note |
|--------------------------------------------------------:|--------------------------------------------------------|-------------------------------------|------------------------------------|
| [ 0](https://srfi.schemers.org/srfi-0/srfi-0.html) | Feature-based conditional expansion construct | [`(srfi 0)`](./basis/srfi-0.ss) | R7RS 4.2.1 |
| [ 1](https://srfi.schemers.org/srfi-1/srfi-1.html) | List Library | [`(srfi 1)`](./basis/srfi-1.ss) | [`(scheme list)`](./basis/r7rs.ss) |
| [ 4](https://srfi.schemers.org/srfi-4/srfi-4.html) | Homogeneous numeric vector datatypes | [`(srfi 4)`](./basis/srfi-4.ss) | R7RS 6.9 |
| [ 6](https://srfi.schemers.org/srfi-6/srfi-6.html) | Basic String Ports | [`(srfi 6)`](./basis/srfi-6.ss) | R7RS 6.13 |
| [ 8](https://srfi.schemers.org/srfi-8/srfi-8.html) | receive: Binding to multiple values | [`(srfi 8)`](./basis/srfi-8.ss) | |
| [ 9](https://srfi.schemers.org/srfi-9/srfi-9.html) | Defining Record Types | [`(srfi 9)`](./basis/srfi-9.ss) | R7RS 5.5 |
| [ 10](https://srfi.schemers.org/srfi-10/srfi-10.html) | #, external form | | |
| [ 11](https://srfi.schemers.org/srfi-11/srfi-11.html) | Syntax for receiving multiple values | [`(srfi 11)`](./basis/srfi-11.ss) | R7RS 4.2.2 |
| [ 16](https://srfi.schemers.org/srfi-16/srfi-16.html) | Syntax for procedures of variable arity | [`(srfi 16)`](./basis/srfi-16.ss) | R7RS 4.2.9 |
| [ 23](https://srfi.schemers.org/srfi-23/srfi-23.html) | Error reporting mechanism | [`(srfi 23)`](./basis/srfi-23.ss) | R7RS 6.11 |
| [ 30](https://srfi.schemers.org/srfi-30/srfi-30.html) | Nested Multi-line Comments | | R7RS 2.2 |
| [ 31](https://srfi.schemers.org/srfi-31/srfi-31.html) | A special form rec for recursive evaluation | [`(srfi 31)`](./basis/srfi-31.ss) | |
| [ 34](https://srfi.schemers.org/srfi-34/srfi-34.html) | Exception Handling for Programs | [`(srfi 34)`](./basis/srfi-34.ss) | R7RS 6.11 |
| [ 38](https://srfi.schemers.org/srfi-38/srfi-38.html) | External Representation for Data With Shared Structure | [`(srfi 38)`](./basis/srfi-38.ss) | R7RS 6.13.3 |
| [ 39](https://srfi.schemers.org/srfi-39/srfi-39.html) | Parameter objects | [`(srfi 39)`](./basis/srfi-39.ss) | R7RS 4.2.6 |
| [ 45](https://srfi.schemers.org/srfi-45/srfi-45.html) | Primitives for Expressing Iterative Lazy Algorithms | [`(srfi 45)`](./basis/srfi-45.ss) | R7RS 4.2.5 |
| [ 62](https://srfi.schemers.org/srfi-62/srfi-62.html) | S-expression comments | | R7RS 2.2 |
| [ 78](https://srfi.schemers.org/srfi-78/srfi-78.html) | Lightweight testing | [`(srfi 78)`](./basis/srfi-78.ss) | Except `check-ec` |
| [ 87](https://srfi.schemers.org/srfi-87/srfi-87.html) | => in case clauses | | R7RS 4.2.1 |
| [ 98](https://srfi.schemers.org/srfi-98/srfi-98.html) | An interface to access environment variables | [`(srfi 98)`](./basis/srfi-98.ss) | R7RS 6.14 |
| [111](https://srfi.schemers.org/srfi-111/srfi-111.html) | Boxes | [`(srfi 111)`](./basis/srfi-111.ss) | [`(scheme box)`](./basis/r7rs.ss) |
| [149](https://srfi.schemers.org/srfi-149/srfi-149.html) | Basic syntax-rules template extensions | [`(srfi 149)`](./basis/srfi-149.ss) | R7RS 4.3.2 |

## Installation

Expand All @@ -91,7 +91,7 @@ Procedures for each standard are provided by the following R7RS-style libraries:
cmake -B build -DCMAKE_BUILD_TYPE=Release
cd build
make package
sudo apt install build/meevax_0.5.32_amd64.deb
sudo apt install build/meevax_0.5.63_amd64.deb
```

or
Expand Down Expand Up @@ -123,9 +123,9 @@ sudo rm -rf /usr/local/share/meevax

| Target Name | Description
|-------------|-------------
| `all` | Build shared-library `libmeevax.0.5.32.so` and executable `meevax`
| `all` | Build shared-library `libmeevax.0.5.63.so` and executable `meevax`
| `test` | Test executable `meevax`
| `package` | Generate debian package `meevax_0.5.32_amd64.deb`
| `package` | Generate debian package `meevax_0.5.63_amd64.deb`
| `install` | Copy files into `/usr/local` directly

## Usage
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.32
0.5.63
Empty file added ]end(
Empty file.
Loading

0 comments on commit 59f3b72

Please sign in to comment.