From 2ee4c7764ac86cccea91df4fcf7f6bf12d4ee67f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20=C5=A0pa=C4=8Dek?= <petr.spacek@nic.cz>
Date: Fri, 1 Dec 2017 14:00:36 +0100
Subject: [PATCH] client: move sources into separate directory

Let's not mix daemon and client files as client might grow to multiple
files in future. This will also help with upcomming changes to packaging
scripts.
---
 .gitignore                 |  2 +-
 Makefile                   |  1 +
 client/client.mk           | 14 ++++++++++++++
 {daemon => client}/kresc.c |  0
 daemon/daemon.mk           | 14 +-------------
 5 files changed, 17 insertions(+), 14 deletions(-)
 create mode 100644 client/client.mk
 rename {daemon => client}/kresc.c (100%)

diff --git a/.gitignore b/.gitignore
index b499e0894..f9fb1f27c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,9 +43,9 @@ _obj
 /aclocal.m4
 /ltmain.sh
 /ylwrap
+/client/kresc
 /doc/doxyxml
 /doc/html
-/daemon/kresc
 /daemon/kresd
 /daemon/lua/*.inc
 /daemon/lua/kres.lua
diff --git a/Makefile b/Makefile
index 3a177936a..1d3cc8a9c 100644
--- a/Makefile
+++ b/Makefile
@@ -187,6 +187,7 @@ $(DESTDIR)$(ETCDIR):
 # Sub-targets
 include contrib/contrib.mk
 include lib/lib.mk
+include client/client.mk
 include daemon/daemon.mk
 include modules/modules.mk
 include tests/tests.mk
diff --git a/client/client.mk b/client/client.mk
new file mode 100644
index 000000000..07508aa30
--- /dev/null
+++ b/client/client.mk
@@ -0,0 +1,14 @@
+# Experimental client requires libedit
+
+ifeq ($(HAS_libedit), yes)
+kresc_SOURCES := client/kresc.c
+kresc_CFLAGS += -fPIE $(libedit_CFLAGS)
+kresc_LIBS += $(contrib_TARGET) $(libedit_LIBS)
+kresc_DEPEND := $(libkres) $(contrib)
+$(eval $(call make_sbin,kresc,client,yes))
+client: $(kresc)
+client-install: kresc-install
+client-clean: kresc-clean
+
+.PHONY: client client-install client-clean
+endif
diff --git a/daemon/kresc.c b/client/kresc.c
similarity index 100%
rename from daemon/kresc.c
rename to client/kresc.c
diff --git a/daemon/daemon.mk b/daemon/daemon.mk
index 09717d22b..d1cef6c22 100644
--- a/daemon/daemon.mk
+++ b/daemon/daemon.mk
@@ -77,16 +77,4 @@ daemon/lua/kres-gen.lua: | $(libkres)
 	daemon/lua/kres-gen.sh | sed 's/    /\t/g' > $@
 .DELETE_ON_ERROR: daemon/lua/kres-gen.lua
 
-# Client
-ifeq ($(HAS_libedit), yes)
-kresc_SOURCES := daemon/kresc.c
-kresc_CFLAGS += -fPIE $(libedit_CFLAGS)
-kresc_LIBS += $(contrib_TARGET) $(libedit_LIBS)
-kresc_DEPEND := $(libkres) $(contrib)
-$(eval $(call make_sbin,kresc,daemon,yes))
-client: $(kresc)
-client-install: kresc-install
-client-clean: kresc-clean
-endif
-
-.PHONY: daemon daemon-install daemon-clean client client-install client-clean
+.PHONY: daemon daemon-install daemon-clean
-- 
GitLab