aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2019-12-18 21:57:51 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2019-12-18 21:57:51 -0500
commit534657dd6fc2ee98159e41d2700554fed0da2c4e (patch)
treed9316757b060d68e5640ea9ecb56b29c62adedfc
parent3166627f1485e2f05421fe874b2236852fe5d017 (diff)
downloadspmc-534657dd6fc2ee98159e41d2700554fed0da2c4e.tar.gz
Refactor project structure
-rw-r--r--CMakeLists.txt8
-rw-r--r--include/spm.h (renamed from spm.h)0
-rw-r--r--src/CMakeLists.txt17
-rw-r--r--src/archive.c (renamed from archive.c)0
-rw-r--r--src/compat.c (renamed from compat.c)0
-rw-r--r--src/config.c (renamed from config.c)0
-rw-r--r--src/config_global.c (renamed from config_global.c)0
-rw-r--r--src/deps.c (renamed from deps.c)0
-rw-r--r--src/find.c (renamed from find.c)0
-rw-r--r--src/fs.c (renamed from fs.c)0
-rw-r--r--src/install.c (renamed from install.c)0
-rw-r--r--src/relocation.c (renamed from relocation.c)0
-rw-r--r--src/rpath.c (renamed from rpath.c)0
-rw-r--r--src/shell.c (renamed from shell.c)0
-rw-r--r--src/spm.c (renamed from spm.c)0
-rw-r--r--src/strings.c (renamed from strings.c)0
16 files changed, 20 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e41eb88..ee2fded 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.15)
project(spm C)
include(CheckSymbolExists)
-
set(CMAKE_C_STANDARD 99)
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
check_symbol_exists(strsep string.h HAVE_STRSEP)
-configure_file(config.h.in config.h)
+configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/include/config.h)
-add_executable(spm spm.c config.c spm.h config.h.in compat.c deps.c fs.c rpath.c find.c shell.c archive.c strings.c relocation.c install.c config_global.c)
-target_link_libraries(spm rt)
+add_subdirectory(src)
diff --git a/spm.h b/include/spm.h
index 9f3ae17..9f3ae17 100644
--- a/spm.h
+++ b/include/spm.h
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..009eb92
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,17 @@
+include_directories(
+ ${CMAKE_SOURCE_DIR}/include
+ ${CMAKE_BINARY_DIR}/include
+)
+
+add_executable(spm spm.c config.c compat.c deps.c fs.c rpath.c find.c shell.c archive.c strings.c relocation.c install.c config_global.c)
+target_link_libraries(spm rt)
+install(
+ TARGETS spm
+ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
+)
+install(
+ FILES
+ ${CMAKE_BINARY_DIR}/include/config.h
+ ${CMAKE_SOURCE_DIR}/include/spm.h
+ DESTINATION "${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}"
+)
diff --git a/archive.c b/src/archive.c
index 7ec9d04..7ec9d04 100644
--- a/archive.c
+++ b/src/archive.c
diff --git a/compat.c b/src/compat.c
index 082a602..082a602 100644
--- a/compat.c
+++ b/src/compat.c
diff --git a/config.c b/src/config.c
index 93ff673..93ff673 100644
--- a/config.c
+++ b/src/config.c
diff --git a/config_global.c b/src/config_global.c
index b1c6dc2..b1c6dc2 100644
--- a/config_global.c
+++ b/src/config_global.c
diff --git a/deps.c b/src/deps.c
index 99f6148..99f6148 100644
--- a/deps.c
+++ b/src/deps.c
diff --git a/find.c b/src/find.c
index 84ded16..84ded16 100644
--- a/find.c
+++ b/src/find.c
diff --git a/fs.c b/src/fs.c
index 27bdf2f..27bdf2f 100644
--- a/fs.c
+++ b/src/fs.c
diff --git a/install.c b/src/install.c
index e647d31..e647d31 100644
--- a/install.c
+++ b/src/install.c
diff --git a/relocation.c b/src/relocation.c
index 13ae799..13ae799 100644
--- a/relocation.c
+++ b/src/relocation.c
diff --git a/rpath.c b/src/rpath.c
index f499e98..f499e98 100644
--- a/rpath.c
+++ b/src/rpath.c
diff --git a/shell.c b/src/shell.c
index 8905c60..8905c60 100644
--- a/shell.c
+++ b/src/shell.c
diff --git a/spm.c b/src/spm.c
index 3607117..3607117 100644
--- a/spm.c
+++ b/src/spm.c
diff --git a/strings.c b/src/strings.c
index ad784d1..ad784d1 100644
--- a/strings.c
+++ b/src/strings.c