diff --git a/.gitignore b/.gitignore index 51f1d410..4013f2fc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,8 @@ bin/* +lib/* +build/* src/lex.yy.c src/lex.yy.h -src/y.tab.c -src/y.tab.h -lib/* .dir-locals.el GPATH GRTAGS diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..fda3f8ae --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.8) + +project(picrin) + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY lib) + +# external libraries +add_library(xfile SHARED extlib/xfile/xfile.c) + +# build picrin +include_directories(include extlib) +link_directories(${PROJECT_SOURCE_DIR}/lib) +include(src/CMakeLists.txt) +include(tools/CMakeLists.txt) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..03910910 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,10 @@ +find_package(FLEX REQUIRED) +execute_process(COMMAND flex scan.l WORKING_DIRECTORY src) + +add_library(picrin SHARED + src/blob.c src/bool.c src/char.c src/codegen.c src/cont.c src/error.c + src/file.c src/gc.c src/init.c src/lex.yy.c src/lib.c src/load.c src/macro.c + src/number.c src/pair.c src/port.c src/proc.c src/read.c src/state.c + src/string.c src/symbol.c src/system.c src/time.c src/var.c src/vector.c + src/vm.c src/write.c) +target_link_libraries(picrin m xfile) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt new file mode 100644 index 00000000..97619e93 --- /dev/null +++ b/tools/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(repl tools/main.c) +set_target_properties(repl PROPERTIES OUTPUT_NAME picrin) +target_link_libraries(repl picrin readline)