abandon cmake

This commit is contained in:
Yuichi Nishiwaki 2015-05-29 20:42:26 +09:00
parent 9b7eb2f996
commit cd4b1be54c
46 changed files with 158 additions and 419 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
build/*
*.o
bin/
lib/
src/load_piclib.c
src/init_contrib.c
docs/contrib.rst

View File

@ -8,8 +8,9 @@ env:
before_script:
- sudo apt-get update -qq
- sudo apt-get install -y libc6:i386 libgcc1:i386 gcc-4.6-base:i386 gcc-multilib
- cd build
script:
- perl --version
- cmake .. && make test
- cmake -DCMAKE_BUILD_TYPE=Debug .. && make test > /dev/null
- make test
- make clean
- make debug
- make test 2> /dev/null >/dev/null

View File

@ -1,48 +0,0 @@
cmake_minimum_required(VERSION 2.6)
cmake_policy(VERSION 2.6)
if(POLICY CMP0037)
cmake_policy(SET CMP0037 OLD)
endif()
PROJECT(picrin)
# load extra cmake modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY lib)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -Wall -Wextra")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -g -DDEBUG=1")
option(STRICT_C89_MODE "Strict c89 mode" OFF)
if(STRICT_C89_MODE)
add_definitions(-std=c89 -ansi -pedantic)
endif()
include_directories(extlib/benz/include)
# build picrin
include(piclib/CMakeLists.txt)
include(contrib/CMakeLists.txt)
include(src/CMakeLists.txt)
include(docs/CMakeLists.txt)
# ----
# $ make run
add_custom_target(run bin/picrin DEPENDS repl)
# $ make test
add_custom_target(test DEPENDS test-r7rs test-contribs)
# $ make test-r7rs
add_custom_target(test-r7rs bin/picrin ${PROJECT_SOURCE_DIR}/t/r7rs-tests.scm DEPENDS repl)
# $ make test-contribs
add_custom_target(test-contribs DEPENDS ${CONTRIB_TESTS})
# $ make tak
add_custom_target(tak bin/picrin ${PROJECT_SOURCE_DIR}/etc/tak.scm DEPENDS repl)
# $ make lines
add_custom_target(lines find . -name "*.[chyl]" | xargs wc -l WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})

86
Makefile Normal file
View File

@ -0,0 +1,86 @@
BENZ_SRCS = $(wildcard extlib/benz/*.c)
BENZ_OBJS = $(BENZ_SRCS:.c=.o)
PICRIN_SRCS = \
src/main.c\
src/load_piclib.c\
src/init_contrib.c
PICRIN_OBJS = \
$(PICRIN_SRCS:.c=.o)
PICRIN_LIBS = \
piclib/picrin/base.scm\
piclib/picrin/macro.scm\
piclib/picrin/record.scm\
piclib/picrin/array.scm\
piclib/picrin/dictionary.scm\
piclib/picrin/experimental/lambda.scm\
piclib/picrin/syntax-rules.scm\
piclib/picrin/test.scm
CONTRIB_SRCS =
CONTRIB_OBJS = $(CONTRIB_SRCS:.c=.o)
CONTRIB_LIBS =
CONTRIB_INITS =
CONTRIB_TESTS =
CONTRIB_DOCS = $(wildcard contrib/*/docs/*.rst)
CFLAGS += -I./extlib/benz/include
# CFLAGS += -std=c89 -ansi -pedantic
prefix = /usr/local
all: CFLAGS += -O2 -Wall -Wextra
all: bin/picrin
include contrib/*/nitro.mk # nitros define test-foo targets
debug: CFLAGS += -O0 -g -DDEBUG=1
debug: bin/picrin
bin/picrin: $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.a
$(CC) $(CFLAGS) -o $@ $(PICRIN_OBJS) $(CONTRIB_OBJS) lib/libbenz.a
src/load_piclib.c: $(PICRIN_LIBS) $(CONTRIB_LIBS)
perl etc/mkloader.pl $(PICRIN_LIBS) $(CONTRIB_LIBS) > $@
src/init_contrib.c:
perl etc/mkinit.pl $(CONTRIB_INITS) > $@
lib/libbenz.a: $(BENZ_OBJS)
$(AR) $(ARFLAGS) $@ $(BENZ_OBJS)
%.o: %.c extlib/benz/include/picrin.h extlib/benz/include/picrin/*.h
$(CC) $(CFLAGS) -c -o $@ $<
doc: docs/*.rst docs/contrib.rst
$(MAKE) -C docs html
mkdir -p doc
cp -uR docs/_build/* -t doc/
docs/contrib.rst: $(CONTRIB_DOCS)
echo "Contrib Libraries \\\(a.k.a nitros\\\)" > $@
echo "================================" >> $@
echo "" >> $@
cat $(CONTRIB_DOCS) >> $@
run: bin/picrin
bin/picrin
test: test-r7rs test-contribs
test-r7rs: bin/picrin t/r7rs-tests.scm
bin/picrin t/r7rs-tests.scm
test-contribs: bin/picrin $(CONTRIB_TESTS)
install: all
install -c bin/picrin $(prefix)/bin/picrin
clean:
rm -f src/load_piclib.c src/init_contrib.c
rm -f lib/libbenz.a
rm -f $(BENZ_OBJS)
rm -f $(PICRIN_OBJS)
rm -f $(CONTRIB_OBJS)
.PHONY: all insall clean run test test-r7rs test-contribs doc $(CONTRIB_TESTS)

BIN
bin/picrin Executable file

Binary file not shown.

View File

@ -1,193 +0,0 @@
##############################################################################
# @file FindPythonInterp.cmake
# @brief Find Python interpreter.
#
# @par Input variables:
# <table border="0">
# <tr>
# @tp @b Python_ADDITIONAL_VERSIONS @endtp
# <td>List of version numbers that should be taken into account when
# searching for Python.</td>
# </tr>
# </table>
#
# @par Output variables:
# <table border="0">
# <tr>
# @tp @b PYTHONINTERP_FOUND @endtp
# <td>Was the Python executable found.</td>
# </tr>
# <tr>
# @tp @b PYTHON_EXECUTABLE @endtp
# <td>Path to the Python interpreter.</td>
# </tr>
# <tr>
# @tp @b PYTHON_VERSION_STRING @endtp
# <td>Python version found e.g. 2.5.2.</td>
# </tr>
# <tr>
# @tp @b PYTHON_VERSION_MAJOR @endtp
# <td>Python major version found e.g. 2.</td>
# </tr>
# <tr>
# @tp @b PYTHON_VERSION_MINOR @endtp
# <td>Python minor version found e.g. 5.</td>
# </tr>
# <tr>
# @tp @b PYTHON_VERSION_PATCH @endtp
# <td>Python patch version found e.g. 2.</td>
# </tr>
# </table>
#
# @note This module has been copied from the Git repository of CMake on
# 4/12/2012, i.e., before the release of CMake 2.8.8. Once CMake 2.8.8
# or any version is available for all major platforms, consider to
# remove this module from the BASIS package.
#
# @ingroup CMakeFindModules
##############################################################################
#=============================================================================
# Copyright 2005-2010 Kitware, Inc.
# Copyright 2011 Bjoern Ricks <bjoern.ricks@gmail.com>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
unset(_Python_NAMES)
set(_PYTHON1_VERSIONS 1.6 1.5)
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
set(_PYTHON3_VERSIONS 3.3 3.2 3.1 3.0)
if(PythonInterp_FIND_VERSION)
if(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" _PYTHON_FIND_MAJ_MIN "${PythonInterp_FIND_VERSION}")
string(REGEX REPLACE "^([0-9]+).*" "\\1" _PYTHON_FIND_MAJ "${_PYTHON_FIND_MAJ_MIN}")
list(APPEND _Python_NAMES python${_PYTHON_FIND_MAJ_MIN} python${_PYTHON_FIND_MAJ})
unset(_PYTHON_FIND_OTHER_VERSIONS)
if(NOT PythonInterp_FIND_VERSION_EXACT)
foreach(_PYTHON_V ${_PYTHON${_PYTHON_FIND_MAJ}_VERSIONS})
if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
endif()
endforeach()
endif(NOT PythonInterp_FIND_VERSION_EXACT)
unset(_PYTHON_FIND_MAJ_MIN)
unset(_PYTHON_FIND_MAJ)
else(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
list(APPEND _Python_NAMES python${PythonInterp_FIND_VERSION})
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonInterp_FIND_VERSION}_VERSIONS})
endif(PythonInterp_FIND_VERSION MATCHES "^[0-9]+\\.[0-9]+(\\.[0-9]+.*)?$")
else(PythonInterp_FIND_VERSION)
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
endif(PythonInterp_FIND_VERSION)
list(APPEND _Python_NAMES python)
# Search for the current active python version first
find_program(PYTHON_EXECUTABLE NAMES ${_Python_NAMES})
# Set up the versions we know about, in the order we will search. Always add
# the user supplied additional versions to the front.
set(_Python_VERSIONS
${Python_ADDITIONAL_VERSIONS}
${_PYTHON_FIND_OTHER_VERSIONS}
)
unset(_PYTHON_FIND_OTHER_VERSIONS)
unset(_PYTHON1_VERSIONS)
unset(_PYTHON2_VERSIONS)
unset(_PYTHON3_VERSIONS)
# Search for newest python version if python executable isn't found
if(NOT PYTHON_EXECUTABLE)
foreach(_CURRENT_VERSION ${_Python_VERSIONS})
set(_Python_NAMES python${_CURRENT_VERSION})
if(WIN32)
list(APPEND _Python_NAMES python)
endif()
find_program(PYTHON_EXECUTABLE
NAMES ${_Python_NAMES}
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]
)
endforeach()
endif()
# determine python version string
if(PYTHON_EXECUTABLE)
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -E -c
"import sys; sys.stdout.write(';'.join([str(x) for x in sys.version_info[:3]]))"
OUTPUT_VARIABLE _VERSION
RESULT_VARIABLE _PYTHON_VERSION_RESULT
ERROR_QUIET)
if(NOT _PYTHON_VERSION_RESULT)
string(REPLACE ";" "." PYTHON_VERSION_STRING "${_VERSION}")
list(GET _VERSION 0 PYTHON_VERSION_MAJOR)
list(GET _VERSION 1 PYTHON_VERSION_MINOR)
list(GET _VERSION 2 PYTHON_VERSION_PATCH)
if(PYTHON_VERSION_PATCH EQUAL 0)
# it's called "Python 2.7", not "2.7.0"
string(REGEX REPLACE "\\.0$" "" PYTHON_VERSION_STRING "${PYTHON_VERSION_STRING}")
endif()
else()
# sys.version predates sys.version_info, so use that
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -E -c "import sys; sys.stdout.write(sys.version)"
OUTPUT_VARIABLE _VERSION
RESULT_VARIABLE _PYTHON_VERSION_RESULT
ERROR_QUIET)
if(NOT _PYTHON_VERSION_RESULT)
string(REGEX REPLACE " .*" "" PYTHON_VERSION_STRING "${_VERSION}")
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+.*" "\\1" PYTHON_VERSION_MAJOR "${PYTHON_VERSION_STRING}")
string(REGEX REPLACE "^[0-9]+\\.([0-9])+.*" "\\1" PYTHON_VERSION_MINOR "${PYTHON_VERSION_STRING}")
if(PYTHON_VERSION_STRING MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+.*")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" PYTHON_VERSION_PATCH "${PYTHON_VERSION_STRING}")
else()
set(PYTHON_VERSION_PATCH "0")
endif()
else()
# sys.version was first documented for Python 1.5, so assume
# this is older.
set(PYTHON_VERSION_STRING "1.4")
set(PYTHON_VERSION_MAJOR "1")
set(PYTHON_VERSION_MINOR "4")
set(PYTHON_VERSION_PATCH "0")
endif()
endif()
unset(_PYTHON_VERSION_RESULT)
unset(_VERSION)
endif(PYTHON_EXECUTABLE)
# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonInterp REQUIRED_VARS PYTHON_EXECUTABLE VERSION_VAR PYTHON_VERSION_STRING)
mark_as_advanced(PYTHON_EXECUTABLE)

View File

@ -1,4 +0,0 @@
file(GLOB PICRIN_CALLCC_SOURCES ${PROJECT_SOURCE_DIR}/contrib/03.callcc/*.c)
list(APPEND PICRIN_CONTRIB_INITS callcc)
list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_CALLCC_SOURCES})

View File

@ -0,0 +1,2 @@
CONTRIB_INITS += callcc
CONTRIB_SRCS += $(wildcard contrib/03.callcc/*.c)

View File

@ -1,4 +0,0 @@
file(GLOB PICRIN_FILE_SOURCES ${PROJECT_SOURCE_DIR}/contrib/03.file/src/*.c)
list(APPEND PICRIN_CONTRIB_INITS file)
list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_FILE_SOURCES})

2
contrib/03.file/nitro.mk Normal file
View File

@ -0,0 +1,2 @@
CONTRIB_INITS += file
CONTRIB_SRCS += $(wildcard contrib/03.file/src/*.c)

View File

@ -1,4 +0,0 @@
file(GLOB PICRIN_LOAD_SOURCES ${PROJECT_SOURCE_DIR}/contrib/03.load/src/*.c)
list(APPEND PICRIN_CONTRIB_INITS load)
list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_LOAD_SOURCES})

2
contrib/03.load/nitro.mk Normal file
View File

@ -0,0 +1,2 @@
CONTRIB_INITS += load
CONTRIB_SRCS += $(wildcard contrib/03.load/src/*.c)

View File

@ -1,5 +0,0 @@
file(GLOB PICRIN_MUTABLE_STRING_SOURCES
${PROJECT_SOURCE_DIR}/contrib/03.mutable-string/*.c)
list(APPEND PICRIN_CONTRIB_INITS mutable_string)
list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_MUTABLE_STRING_SOURCES})

View File

@ -0,0 +1,2 @@
CONTRIB_INITS += mutable_string
CONTRIB_SRCS += $(wildcard contrib/03.mutable-string/*.c)

View File

@ -1,4 +0,0 @@
file(GLOB PICRIN_SYSTEM_SOURCES ${PROJECT_SOURCE_DIR}/contrib/03.system/src/*.c)
list(APPEND PICRIN_CONTRIB_INITS system)
list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_SYSTEM_SOURCES})

View File

@ -0,0 +1,2 @@
CONTRIB_INITS += system
CONTRIB_SRCS += $(wildcard contrib/03.system/src/*.c)

View File

@ -1,4 +0,0 @@
file(GLOB PICRIN_TIME_SOURCES ${PROJECT_SOURCE_DIR}/contrib/03.time/src/*.c)
list(APPEND PICRIN_CONTRIB_INITS time)
list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_TIME_SOURCES})

2
contrib/03.time/nitro.mk Normal file
View File

@ -0,0 +1,2 @@
CONTRIB_INITS += time
CONTRIB_SRCS += $(wildcard contrib/03.time/src/*.c)

View File

@ -1,15 +0,0 @@
list(APPEND PICLIB_SCHEME_LIBS
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/base.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/cxr.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/read.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/write.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/file.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/case-lambda.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/lazy.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/eval.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/inexact.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/load.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/process-context.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/time.scm
${PROJECT_SOURCE_DIR}/contrib/05.r7rs/scheme/r5rs.scm
)

14
contrib/05.r7rs/nitro.mk Normal file
View File

@ -0,0 +1,14 @@
CONTRIB_LIBS += \
contrib/05.r7rs/scheme/base.scm\
contrib/05.r7rs/scheme/cxr.scm\
contrib/05.r7rs/scheme/read.scm\
contrib/05.r7rs/scheme/write.scm\
contrib/05.r7rs/scheme/file.scm\
contrib/05.r7rs/scheme/case-lambda.scm\
contrib/05.r7rs/scheme/lazy.scm\
contrib/05.r7rs/scheme/eval.scm\
contrib/05.r7rs/scheme/inexact.scm\
contrib/05.r7rs/scheme/load.scm\
contrib/05.r7rs/scheme/process-context.scm\
contrib/05.r7rs/scheme/time.scm\
contrib/05.r7rs/scheme/r5rs.scm

View File

@ -1,9 +0,0 @@
file(GLOB OPTIONAL_FILES ${PROJECT_SOURCE_DIR}/contrib/10.optional/piclib/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${OPTIONAL_FILES})
add_custom_target(test-optional
for test in ${PROJECT_SOURCE_DIR}/contrib/10.optional/t/*.scm \;
do
bin/picrin "$$test" \;
done
DEPENDS repl)
set(CONTRIB_TESTS ${CONTRIB_TESTS} test-optional)

View File

@ -0,0 +1,7 @@
CONTRIB_LIBS += $(wildcard contrib/10.optional/piclib/*.scm)
CONTRIB_TESTS += test-optional
test-optional: bin/picrin
for test in `ls contrib/10.optional/t/*.scm`; do \
bin/picrin $$test; \
done

View File

@ -1,2 +0,0 @@
file(GLOB PARTCONT_FILES ${PROJECT_SOURCE_DIR}/contrib/10.partcont/piclib/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${PARTCONT_FILES})

View File

@ -0,0 +1 @@
CONTRIB_LIBS += $(wildcard contrib/10.partcont/piclib/*.scm)

View File

@ -1 +0,0 @@
list(APPEND PICLIB_CONTRIB_LIBS ${PROJECT_SOURCE_DIR}/contrib/10.pretty-print/pretty-print.scm)

View File

@ -0,0 +1 @@
CONTRIB_LIBS += contrib/10.pretty-print/pretty-print.scm

View File

@ -1,11 +0,0 @@
file(GLOB PICRIN_RANDOM_SOURCES ${PROJECT_SOURCE_DIR}/contrib/10.random/src/*.c)
list(APPEND PICRIN_CONTRIB_INITS random)
list(APPEND PICRIN_CONTRIB_SOURCES ${PICRIN_RANDOM_SOURCES})
add_custom_target(test-random
for test in ${PROJECT_SOURCE_DIR}/contrib/10.random/t/*.scm \;
do
bin/picrin "$$test" \;
done
DEPENDS repl)
set(CONTRIB_TESTS ${CONTRIB_TESTS} test-random)

View File

@ -0,0 +1,8 @@
CONTRIB_INITS += random
CONTRIB_SRCS += $(wildcard contrib/10.random/src/*.c)
CONTRIB_TESTS += test-random
test-random: bin/picrin
for test in `ls contrib/10.random/t/*.scm`; do \
bin/picrin $$test; \
done

View File

@ -1,10 +0,0 @@
list(APPEND PICLIB_CONTRIB_LIBS
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/1.scm
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/8.scm
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/17.scm
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/26.scm
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/43.scm
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/60.scm
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/95.scm
${PROJECT_SOURCE_DIR}/contrib/10.srfi/srfi/111.scm
)

9
contrib/10.srfi/nitro.mk Normal file
View File

@ -0,0 +1,9 @@
CONTRIB_LIBS += \
contrib/10.srfi/srfi/1.scm\
contrib/10.srfi/srfi/8.scm\
contrib/10.srfi/srfi/17.scm\
contrib/10.srfi/srfi/26.scm\
contrib/10.srfi/srfi/43.scm\
contrib/10.srfi/srfi/60.scm\
contrib/10.srfi/srfi/95.scm\
contrib/10.srfi/srfi/111.scm

View File

@ -1,4 +0,0 @@
file(GLOB FOR_FILES ${PROJECT_SOURCE_DIR}/contrib/20.for/piclib/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${FOR_FILES})
add_custom_target(test-for for test in ${PROJECT_SOURCE_DIR}/contrib/20.for/t/*.scm \; do bin/picrin "$$test" \; done DEPENDS repl)
set(CONTRIB_TESTS ${CONTRIB_TESTS} test-for)

7
contrib/20.for/nitro.mk Normal file
View File

@ -0,0 +1,7 @@
CONTRIB_LIBS += $(wildcard contrib/20.for/piclib/*.scm)
CONTRIB_TESTS += test-for
test-for: bin/picrin
for test in `ls contrib/20.for/t/*.scm`; do \
bin/picrin "$$test"; \
done

View File

@ -1,3 +0,0 @@
list(APPEND PICLIB_CONTRIB_LIBS ${PROJECT_SOURCE_DIR}/contrib/20.repl/repl.scm)
list(APPEND PICRIN_CONTRIB_SOURCES ${PROJECT_SOURCE_DIR}/contrib/20.repl/repl.c)
list(APPEND PICRIN_CONTRIB_INITS repl)

3
contrib/20.repl/nitro.mk Normal file
View File

@ -0,0 +1,3 @@
CONTRIB_LIBS += contrib/20.repl/repl.scm
CONTRIB_SRCS += contrib/20.repl/repl.c
CONTRIB_INITS += repl

View File

@ -1 +0,0 @@
list(APPEND PICLIB_CONTRIB_LIBS ${PROJECT_SOURCE_DIR}/contrib/30.main/main.scm)

1
contrib/30.main/nitro.mk Normal file
View File

@ -0,0 +1 @@
CONTRIB_LIBS += contrib/30.main/main.scm

View File

@ -1,2 +0,0 @@
file(GLOB CLASS_FILES ${PROJECT_SOURCE_DIR}/contrib/40.class/piclib/picrin/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${CLASS_FILES})

View File

@ -0,0 +1 @@
CONTRIB_LIBS += $(wildcard contrib/40.class/piclib/picrin/*.scm)

View File

@ -1,2 +0,0 @@
file(GLOB PROTOCOL_FILES ${PROJECT_SOURCE_DIR}/contrib/50.protocol/piclib/picrin/*.scm)
list(APPEND PICLIB_CONTRIB_LIBS ${PROTOCOL_FILES})

View File

@ -0,0 +1 @@
CONTRIB_LIBS += $(wildcard contrib/50.protocol/piclib/picrin/*.scm)

View File

@ -1,5 +0,0 @@
file(GLOB CONTRIBS ${PROJECT_SOURCE_DIR}/contrib/*/CMakeLists.txt)
list(SORT CONTRIBS)
foreach(contrib ${CONTRIBS})
include(${contrib})
endforeach()

View File

@ -1,27 +0,0 @@
# contribs
file(GLOB PICRIN_CONTRIB_DOCS ${PROJECT_SOURCE_DIR}/contrib/*/docs/*.rst)
file(GLOB PICRIN_DOCS ${PROJECT_SOURCE_DIR}/docs/*.rst)
list(SORT PICRIN_CONTRIB_DOCS)
set(PICRIN_CONTRIBS_DOC ${PROJECT_SOURCE_DIR}/docs/contrib.rst)
set(PICRIN_DOC_OUTPUT_DIRECTORY doc)
add_custom_command(
OUTPUT ${PICRIN_CONTRIBS_DOC}
COMMAND echo "Contrib Libraries \\\(a.k.a nitros\\\)" > ${PICRIN_CONTRIBS_DOC}
COMMAND echo "================================" >> ${PICRIN_CONTRIBS_DOC}
COMMAND echo "" >> ${PICRIN_CONTRIBS_DOC}
COMMAND cat ${PICRIN_CONTRIB_DOCS} >> ${PICRIN_CONTRIBS_DOC}
DEPENDS ${PICRIN_CONTRIB_DOCS}
)
add_custom_target(doc
COMMAND make -C ${PROJECT_SOURCE_DIR}/docs html
DEPENDS ${PICRIN_CONTRIBS_DOC}
)
add_custom_command(
TARGET doc POST_BUILD
COMMAND mkdir -p ${PICRIN_DOC_OUTPUT_DIRECTORY}
COMMAND cp -uR ${PROJECT_SOURCE_DIR}/docs/_build/* -t ${PICRIN_DOC_OUTPUT_DIRECTORY}/
)

View File

@ -1,10 +0,0 @@
list(APPEND PICLIB_SCHEME_LIBS
${PROJECT_SOURCE_DIR}/piclib/picrin/base.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/macro.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/record.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/array.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/dictionary.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/experimental/lambda.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/syntax-rules.scm
${PROJECT_SOURCE_DIR}/piclib/picrin/test.scm
)

View File

@ -1,47 +0,0 @@
### libpicrin ###
find_package(Perl REQUIRED)
# benz
file(GLOB BENZ_SOURCES extlib/benz/*.c)
# srcs
file(GLOB PICRIN_SOURCES src/*.c)
# piclib
set(PICLIB_SOURCE ${PROJECT_SOURCE_DIR}/src/load_piclib.c)
add_custom_command(
OUTPUT ${PICLIB_SOURCE}
COMMAND ${PERL_EXECUTABLE} etc/mkloader.pl ${PICLIB_SCHEME_LIBS} ${PICLIB_CONTRIB_LIBS} > ${PICLIB_SOURCE}
DEPENDS ${PICLIB_SCHEME_LIBS} ${PICLIB_CONTRIB_LIBS}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
# contrib
set(CONTRIB_INIT ${PROJECT_SOURCE_DIR}/src/init_contrib.c)
add_custom_command(
OUTPUT ${CONTRIB_INIT}
COMMAND ${PERL_EXECUTABLE} etc/mkinit.pl ${PICRIN_CONTRIB_INITS} > ${CONTRIB_INIT}
DEPENDS ${PICRIN_CONTRIB_SOURCES}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
add_library(picrin SHARED ${BENZ_SOURCES} ${PICRIN_SOURCES} ${PICLIB_SOURCE} ${PICRIN_CONTRIB_SOURCES} ${CONTRIB_INIT})
target_link_libraries(picrin m ${PICRIN_CONTRIB_LIBRARIES})
# install
set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)
install(TARGETS picrin DESTINATION lib)
install(DIRECTORY extlib/benz/include/ DESTINATION include FILES_MATCHING PATTERN "*.h")
### picrin ###
list(APPEND REPL_LIBRARIES picrin)
# build
add_executable(repl src/main.c)
set_target_properties(repl PROPERTIES OUTPUT_NAME picrin)
target_link_libraries(repl ${REPL_LIBRARIES})
# install
install(TARGETS repl RUNTIME DESTINATION bin)