summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-23 16:25:36 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-23 16:25:36 +0200
commit8c27290245b7bcc7cd2f72f3b4a7562294b43bbe (patch)
tree54bae7909a94bfc598df7b88d9794742daf0bb31
parent973ae757342b91e3e6aafd07e0c0a24af84aad98 (diff)
Split directories better
-rw-r--r--mcserverctl/mcserverctl.c (renamed from mcserverctl.c)1
-rw-r--r--mcserverctl/meson.build14
-rw-r--r--mcserverproxy/announce.c (renamed from announce.c)0
-rw-r--r--mcserverproxy/announce.h (renamed from announce.h)0
-rw-r--r--mcserverproxy/config-parser.c (renamed from config-parser.c)0
-rw-r--r--mcserverproxy/config-parser.h (renamed from config-parser.h)0
-rw-r--r--mcserverproxy/idle.c (renamed from idle.c)0
-rw-r--r--mcserverproxy/idle.h (renamed from idle.h)0
-rw-r--r--mcserverproxy/igmp.c (renamed from igmp.c)0
-rw-r--r--mcserverproxy/igmp.h (renamed from igmp.h)0
-rw-r--r--mcserverproxy/main.c (renamed from main.c)0
-rw-r--r--mcserverproxy/main.h (renamed from main.h)0
-rw-r--r--mcserverproxy/meson.build36
-rw-r--r--mcserverproxy/ptimer.c (renamed from ptimer.c)0
-rw-r--r--mcserverproxy/ptimer.h (renamed from ptimer.h)0
-rw-r--r--mcserverproxy/server-config.c (renamed from server-config.c)0
-rw-r--r--mcserverproxy/server-config.h (renamed from server-config.h)0
-rw-r--r--mcserverproxy/server-proxy.c (renamed from server-proxy.c)0
-rw-r--r--mcserverproxy/server-proxy.h (renamed from server-proxy.h)0
-rw-r--r--mcserverproxy/server-rcon.c (renamed from server-rcon.c)0
-rw-r--r--mcserverproxy/server-rcon.h (renamed from server-rcon.h)0
-rw-r--r--mcserverproxy/server.c (renamed from server.c)0
-rw-r--r--mcserverproxy/server.h (renamed from server.h)0
-rw-r--r--mcserverproxy/signal-handler.c (renamed from signal-handler.c)0
-rw-r--r--mcserverproxy/signal-handler.h (renamed from signal-handler.h)0
-rw-r--r--mcserverproxy/systemd.c (renamed from systemd.c)0
-rw-r--r--mcserverproxy/systemd.h (renamed from systemd.h)0
-rw-r--r--mcserverproxy/uring.c (renamed from uring.c)0
-rw-r--r--mcserverproxy/uring.h (renamed from uring.h)0
-rw-r--r--mcserverproxy/utils.c (renamed from utils.c)0
-rw-r--r--mcserverproxy/utils.h (renamed from utils.h)0
-rw-r--r--meson.build54
-rw-r--r--shared/meson.build22
-rw-r--r--shared/rcon-protocol.c (renamed from rcon-protocol.c)0
-rw-r--r--shared/rcon-protocol.h (renamed from rcon-protocol.h)0
35 files changed, 79 insertions, 48 deletions
diff --git a/mcserverctl.c b/mcserverctl/mcserverctl.c
index 8a799a2..e29dcef 100644
--- a/mcserverctl.c
+++ b/mcserverctl/mcserverctl.c
@@ -5,7 +5,6 @@
#include "rcon-protocol.h"
-
int
main(int argc, char **argv)
{
diff --git a/mcserverctl/meson.build b/mcserverctl/meson.build
new file mode 100644
index 0000000..4e960b7
--- /dev/null
+++ b/mcserverctl/meson.build
@@ -0,0 +1,14 @@
+mcserverctl_sources = [
+ 'mcserverctl.c',
+]
+
+mcserverctl_deps = [
+ dep_libshared,
+]
+
+executable(
+ 'mcserverctl',
+ mcserverctl_sources,
+ dependencies: mcserverctl_deps,
+)
+
diff --git a/announce.c b/mcserverproxy/announce.c
index 13ef423..13ef423 100644
--- a/announce.c
+++ b/mcserverproxy/announce.c
diff --git a/announce.h b/mcserverproxy/announce.h
index 77a36f2..77a36f2 100644
--- a/announce.h
+++ b/mcserverproxy/announce.h
diff --git a/config-parser.c b/mcserverproxy/config-parser.c
index ffed7f1..ffed7f1 100644
--- a/config-parser.c
+++ b/mcserverproxy/config-parser.c
diff --git a/config-parser.h b/mcserverproxy/config-parser.h
index 3a117a3..3a117a3 100644
--- a/config-parser.h
+++ b/mcserverproxy/config-parser.h
diff --git a/idle.c b/mcserverproxy/idle.c
index c49846d..c49846d 100644
--- a/idle.c
+++ b/mcserverproxy/idle.c
diff --git a/idle.h b/mcserverproxy/idle.h
index d7e4ab0..d7e4ab0 100644
--- a/idle.h
+++ b/mcserverproxy/idle.h
diff --git a/igmp.c b/mcserverproxy/igmp.c
index dc43a9f..dc43a9f 100644
--- a/igmp.c
+++ b/mcserverproxy/igmp.c
diff --git a/igmp.h b/mcserverproxy/igmp.h
index 80875b0..80875b0 100644
--- a/igmp.h
+++ b/mcserverproxy/igmp.h
diff --git a/main.c b/mcserverproxy/main.c
index 047e70e..047e70e 100644
--- a/main.c
+++ b/mcserverproxy/main.c
diff --git a/main.h b/mcserverproxy/main.h
index 256ddae..256ddae 100644
--- a/main.h
+++ b/mcserverproxy/main.h
diff --git a/mcserverproxy/meson.build b/mcserverproxy/meson.build
new file mode 100644
index 0000000..e5fa7bc
--- /dev/null
+++ b/mcserverproxy/meson.build
@@ -0,0 +1,36 @@
+mcproxy_sources = [
+ 'main.c',
+ 'uring.c',
+ 'signal-handler.c',
+ 'server.c',
+ 'server-proxy.c',
+ 'server-config.c',
+ 'server-rcon.c',
+ 'announce.c',
+ 'config-parser.c',
+ 'idle.c',
+ 'ptimer.c',
+ 'igmp.c',
+ 'systemd.c',
+ 'utils.c'
+]
+
+dep_liburing = dependency('liburing')
+dep_libsystemd = dependency('libsystemd')
+dep_libcapng = dependency('libcap-ng')
+
+mcproxy_deps = [
+ dep_liburing,
+ dep_libsystemd,
+ dep_libcapng,
+ dep_config_h,
+ dep_libshared,
+]
+
+executable(
+ 'mcproxy',
+ mcproxy_sources,
+ link_args: [ '-lanl' ],
+ dependencies: mcproxy_deps,
+)
+
diff --git a/ptimer.c b/mcserverproxy/ptimer.c
index 5f9cf5d..5f9cf5d 100644
--- a/ptimer.c
+++ b/mcserverproxy/ptimer.c
diff --git a/ptimer.h b/mcserverproxy/ptimer.h
index 0b53590..0b53590 100644
--- a/ptimer.h
+++ b/mcserverproxy/ptimer.h
diff --git a/server-config.c b/mcserverproxy/server-config.c
index 549cf16..549cf16 100644
--- a/server-config.c
+++ b/mcserverproxy/server-config.c
diff --git a/server-config.h b/mcserverproxy/server-config.h
index 590dae0..590dae0 100644
--- a/server-config.h
+++ b/mcserverproxy/server-config.h
diff --git a/server-proxy.c b/mcserverproxy/server-proxy.c
index 4cbbb87..4cbbb87 100644
--- a/server-proxy.c
+++ b/mcserverproxy/server-proxy.c
diff --git a/server-proxy.h b/mcserverproxy/server-proxy.h
index ee3bda3..ee3bda3 100644
--- a/server-proxy.h
+++ b/mcserverproxy/server-proxy.h
diff --git a/server-rcon.c b/mcserverproxy/server-rcon.c
index 1f8ef70..1f8ef70 100644
--- a/server-rcon.c
+++ b/mcserverproxy/server-rcon.c
diff --git a/server-rcon.h b/mcserverproxy/server-rcon.h
index 6625f25..6625f25 100644
--- a/server-rcon.h
+++ b/mcserverproxy/server-rcon.h
diff --git a/server.c b/mcserverproxy/server.c
index de42721..de42721 100644
--- a/server.c
+++ b/mcserverproxy/server.c
diff --git a/server.h b/mcserverproxy/server.h
index ff4c28e..ff4c28e 100644
--- a/server.h
+++ b/mcserverproxy/server.h
diff --git a/signal-handler.c b/mcserverproxy/signal-handler.c
index 67c2e0b..67c2e0b 100644
--- a/signal-handler.c
+++ b/mcserverproxy/signal-handler.c
diff --git a/signal-handler.h b/mcserverproxy/signal-handler.h
index e0140b3..e0140b3 100644
--- a/signal-handler.h
+++ b/mcserverproxy/signal-handler.h
diff --git a/systemd.c b/mcserverproxy/systemd.c
index a44b0d8..a44b0d8 100644
--- a/systemd.c
+++ b/mcserverproxy/systemd.c
diff --git a/systemd.h b/mcserverproxy/systemd.h
index d455044..d455044 100644
--- a/systemd.h
+++ b/mcserverproxy/systemd.h
diff --git a/uring.c b/mcserverproxy/uring.c
index e979471..e979471 100644
--- a/uring.c
+++ b/mcserverproxy/uring.c
diff --git a/uring.h b/mcserverproxy/uring.h
index 9c33104..9c33104 100644
--- a/uring.h
+++ b/mcserverproxy/uring.h
diff --git a/utils.c b/mcserverproxy/utils.c
index eacc586..eacc586 100644
--- a/utils.c
+++ b/mcserverproxy/utils.c
diff --git a/utils.h b/mcserverproxy/utils.h
index c36a36c..c36a36c 100644
--- a/utils.h
+++ b/mcserverproxy/utils.h
diff --git a/meson.build b/meson.build
index eb446fe..1f8424a 100644
--- a/meson.build
+++ b/meson.build
@@ -13,7 +13,8 @@ conf.set_quoted('VERSION', '@0@-@VCS_TAG@'.format(meson.project_version()))
conf.set_quoted('DEFAULT_CFG_DIR', sysconfdir)
conf.set_quoted('DEFAULT_MAIN_CFG_FILE', mainconfname)
-config_h = declare_dependency(
+inc_config_h = include_directories('.')
+dep_config_h = declare_dependency(
sources: vcs_tag(
command: ['git', 'rev-parse', '--short', 'HEAD'],
fallback: get_option('profile') != 'default' ? 'devel' : 'stable',
@@ -23,52 +24,11 @@ config_h = declare_dependency(
configuration: conf
),
output: 'config.h'
- )
+ ),
+ include_directories : inc_config_h,
)
-configuration_inc = include_directories('.')
-
-liburing = dependency('liburing')
-libsystemd = dependency('libsystemd')
-libcapng = dependency('libcap-ng')
-
-mcproxy_sources = [
- 'main.c',
- 'uring.c',
- 'signal-handler.c',
- 'server.c',
- 'server-proxy.c',
- 'server-config.c',
- 'server-rcon.c',
- 'rcon-protocol.c',
- 'announce.c',
- 'config-parser.c',
- 'idle.c',
- 'ptimer.c',
- 'igmp.c',
- 'systemd.c',
- 'utils.c'
-]
-
-mcserverctl_sources = [
- 'mcserverctl.c',
- 'rcon-protocol.c',
-]
-
-executable('mcproxy',
- mcproxy_sources,
- link_args: [ '-lanl' ],
- include_directories : configuration_inc,
- dependencies: [
- liburing,
- libsystemd,
- libcapng,
- config_h
- ],
-)
-
-executable('mcserverctl',
- mcserverctl_sources,
- include_directories : configuration_inc,
-)
+subdir('shared')
+subdir('mcserverproxy')
+subdir('mcserverctl')
diff --git a/shared/meson.build b/shared/meson.build
new file mode 100644
index 0000000..cbb7dca
--- /dev/null
+++ b/shared/meson.build
@@ -0,0 +1,22 @@
+srcs_libshared = [
+ 'rcon-protocol.c',
+]
+
+inc_libshared = include_directories('.')
+
+deps_libshared = []
+
+lib_libshared = static_library(
+ 'shared',
+ srcs_libshared,
+ pic: true,
+ install: false,
+ dependencies: deps_libshared,
+)
+
+dep_libshared = declare_dependency(
+ link_with: lib_libshared,
+ dependencies: deps_libshared,
+ include_directories: inc_libshared,
+)
+
diff --git a/rcon-protocol.c b/shared/rcon-protocol.c
index 0ea1245..0ea1245 100644
--- a/rcon-protocol.c
+++ b/shared/rcon-protocol.c
diff --git a/rcon-protocol.h b/shared/rcon-protocol.h
index 35997c4..35997c4 100644
--- a/rcon-protocol.h
+++ b/shared/rcon-protocol.h