From d32626349cd8cbeefd8693ff8fbae51a21a70f8e Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Tue, 8 Oct 2013 02:01:08 +0200 Subject: [PATCH 1/2] build system: rename Makefile{,.old} --- Makefile | 4 ---- Makefile.old | 4 ++++ src/{Makefile => Makefile.old} | 0 3 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 Makefile create mode 100644 Makefile.old rename src/{Makefile => Makefile.old} (100%) diff --git a/Makefile b/Makefile deleted file mode 100644 index 1c79ae9..0000000 --- a/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -default: all - -.DEFAULT: - cd src && $(MAKE) $@ diff --git a/Makefile.old b/Makefile.old new file mode 100644 index 0000000..d183a1a --- /dev/null +++ b/Makefile.old @@ -0,0 +1,4 @@ +default: all + +.DEFAULT: + make -C src/ -f Makefile.old $@ diff --git a/src/Makefile b/src/Makefile.old similarity index 100% rename from src/Makefile rename to src/Makefile.old From d7c1a3de92ba436354a7dd0596f45b0826c42bca Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Tue, 8 Oct 2013 02:01:21 +0200 Subject: [PATCH 2/2] introduce cmake as build system (proof of concept) Please review the contents of the CMakeLists.txt files; they are pretty easy to understand and to extend. I chose cmake as libsmatrix (as a embedded external project) is very easy to integrate into dawanda_recommender project. I considered using automake, too, but cmake was just easier to get running. Feel free to counter this with an automake-solution, that easily integrates into dawanda_recommender, too. ;-) --- .gitignore | 6 ++++++ CMakeLists.txt | 4 ++++ src/CMakeLists.txt | 7 +++++++ 3 files changed, 17 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 src/CMakeLists.txt diff --git a/.gitignore b/.gitignore index 8ef5052..925a7ae 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,9 @@ *.bundle *.so smatrix_example +*.csv + +cmake_install.cmake +CMakeCache.txt +CMakeFiles +*.so.* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..4a020b9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,4 @@ +project(libsmatrix) +cmake_minimum_required(VERSION 2.8) +set(PACKAGE_VERSION "0.1.0") +add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..addf686 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,7 @@ +add_definitions(-Wall -Wno-deprecated -DPACKAGE_VERSION="${PACKAGE_VERSION}") +#add_definitions(-fvisibility=hidden -fvisibility-inlines-hidden -DBUILD_LIBSMATRIX=1) +set(CMAKE_C_FLAGS "-std=c11 -pthread") + +add_library(smatrix SHARED smatrix.c) +target_link_libraries(smatrix pthread m) +set_target_properties(smatrix PROPERTIES VERSION ${PACKAGE_VERSION})