Replace cmake by raw Makefile.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 9 Sep 2013 21:39:15 +0000 (23:39 +0200)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Mon, 9 Sep 2013 21:54:35 +0000 (23:54 +0200)
CMakeLists.txt [deleted file]
Makefile [new file with mode: 0644]
cmake/modules/FindDMLite.cmake [deleted file]
src/CMakeLists.txt [deleted file]

diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100644 (file)
index 8af6ad6..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-
-project (dmlite-plugins-vfs)
-
-# Version
-set(dmlite_MAJOR 0)
-set(dmlite_MINOR 1)
-set(dmlite_PATCH 0)
-
-# Lib suffix
-if (CMAKE_SIZEOF_VOID_P EQUAL 4)
-  set (LIB_SUFFIX ""
-               CACHE STRING "library directory suffix value")
-else (CMAKE_SIZEOF_VOID_P EQUAL 4)
-  set (LIB_SUFFIX "64"
-               CACHE STRING "library directory suffix value")
-endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
-
-# Cmake module directory
-set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
-
-# Packages
-set (BOOST_INCLUDEDIR "/usr/include/boost141") # EPEL5
-find_package (Boost 1.41 REQUIRED)
-find_package (DMLite   REQUIRED)
-
-include_directories (${Boost_INCLUDE_DIR} ${DMLITE_INCLUDE_DIR})
-
-# Definitions
-add_definitions (-D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64)
-
-# Subdirectories
-add_subdirectory (src)
-
-# Configuration files
-configure_file (${CMAKE_CURRENT_SOURCE_DIR}/etc/vfs.conf.in
-                ${CMAKE_CURRENT_BINARY_DIR}/etc/vfs.conf
-                @ONLY)
-
-install (FILES       ${CMAKE_CURRENT_BINARY_DIR}/etc/vfs.conf
-         DESTINATION etc/dmlite.conf.d)
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..828ff94
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+top_srcdir=.
+version=1.0.0
+prefix=/usr
+libarch=lib
+
+-include Makefile.inc
+
+VPATH=$(top_srcdir)/src
+
+CPPFLAGS+=-D_REENTRANT -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+CXXFLAGS+=-W -Wall -Wno-unused -g -O2
+LDFLAGS=
+COMPILE=libtool --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS)
+LINK=libtool --mode=link $(CXX) $(LDFLAGS)
+INSTALL=libtool --mode=install install
+
+DMLITE_PREFIX?=/usr
+DMLITE_CPPFLAGS?=-I$(DMLITE_PREFIX)/include
+DMLITE_LIBS?=-L$(DMLITE_PREFIX)/$(libarch) -ldmlite
+
+OBJS=Throw.lo Vfs.lo VfsDriver.lo VfsIO.lo VfsNs.lo VfsPool.lo
+LIB=plugin_vfs.la
+
+all: $(LIB)
+
+$(LIB): $(OBJS)
+       $(LINK) -module -rpath $(prefix)/$(libarch) $(DMLITE_LIBS) $(LIBS) $+ -o $@
+
+install:
+       -mkdir -p $(DESTDIR)$(prefix)/$(libarch)/dmlite
+       $(INSTALL) $(LIB) $(DESTDIR)$(prefix)/$(libarch)/dmlite
+
+clean:
+       rm -fv *.la *.lo *.o
+       rm -rvf .libs
+
+%.o %.lo: %.cpp
+       $(COMPILE) $(DMLITE_CPPFLAGS) -c $<
+
+Throw.cpp: Vfs.h
+Vfs.cpp: Vfs.h VfsDriver.h VfsIO.h VfsNs.h VfsPool.h
+VfsDriver.cpp: Vfs.h VfsDriver.h
+VfsIO.cpp: Vfs.h VfsIO.h
+VfsNs.cpp: Vfs.h VfsNs.h
+VfsPool.cpp: Vfs.h VfsPool.h
diff --git a/cmake/modules/FindDMLite.cmake b/cmake/modules/FindDMLite.cmake
deleted file mode 100644 (file)
index cb4d931..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# - Try to find DMLITE libraries
-#
-#  DMLITE_FOUND - System has DMLITE
-#  DMLITE_INCLUDE_DIR - The DMLITE include directory
-#  DMLITE_LIBRARIES - The libraries needed to use DMLITE
-#
-# DMLITE_LOCATION
-#   setting this enables search for dmlite libraries / headers in this location
-
-
-# -----------------------------------------------------
-# DMLITE Libraries
-# -----------------------------------------------------
-find_library(DMLITE_LIBRARIES
-    NAMES dmlite
-    HINTS ${DMLITE_LOCATION}/lib ${DMLITE_LOCATION}/lib64 ${DMLITE_LOCATION}/lib32
-    DOC "The main dmlite library"
-)
-if(DMLITE_LIBRARIES)
-    message(STATUS "dmlite library found in ${DMLITE_LIBRARIES}")
-endif()
-
-# -----------------------------------------------------
-# DMLITE Include Directories
-# -----------------------------------------------------
-find_path(DMLITE_INCLUDE_DIR
-    NAMES dmlite/c/dmlite.h dmlite/cpp/dmlite++.h
-    HINTS ${DMLITE_LOCATION} ${DMLITE_LOCATION}/include ${DMLITE_LOCATION}/include/*
-    DOC "The dmlite include directory"
-)
-if(DMLITE_INCLUDE_DIR)
-    message(STATUS "dmlite includes found in ${DMLITE_INCLUDE_DIR}")
-endif()
-
-# -----------------------------------------------------
-# handle the QUIETLY and REQUIRED arguments and set DMLITE_FOUND to TRUE if
-# all listed variables are TRUE
-# -----------------------------------------------------
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(dmlite DEFAULT_MSG DMLITE_LIBRARIES DMLITE_INCLUDE_DIR)
-mark_as_advanced(DMLITE_INCLUDE_DIR DMLITE_LIBRARIES)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
deleted file mode 100644 (file)
index 7c21c55..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-
-add_library (vfs MODULE Vfs.cpp
-                        VfsDriver.cpp
-                        VfsIO.cpp
-                        VfsNs.cpp
-                        VfsPool.cpp
-                        Throw.cpp
-            )
-
-target_link_libraries (vfs ${DMLITE_LIBRARIES})
-set_target_properties (vfs PROPERTIES PREFIX "plugin_")
-
-install (TARGETS       vfs
-         LIBRARY       DESTINATION usr/lib${LIB_SUFFIX}/dmlite/
-                       COMPONENT   dmlite-plugins)