Permalink
Browse files

Modified the Makefile to make the library and server installable.

  • Loading branch information...
1 parent 1127394 commit f5261fdb4ab35c23973e91bb65677ec007a9feca @goossaert committed Mar 8, 2015
View
@@ -19,7 +19,11 @@ CLIENT_NETWORK=client_network
CLIENT_EMB=client_emb
TEST_COMPRESSION=test_compression
TEST_DB=test_db
-LIBRARY=kingdb.a
+LIBRARY=libkingdb.a
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+INCLUDEDIR=$(PREFIX)/include/kingdb
+LIBDIR=$(PREFIX)/lib
CFLAGS=-std=c++11 -c
@@ -61,6 +65,19 @@ $(LIBRARY): $(OBJECTS)
rm -f $@
ar -rs $@ $(OBJECTS)
+install: $(EXECUTABLE)
+ install $(EXECUTABLE) $(BINDIR)
+ cp libkingdb.a $(LIBDIR)
+ rm -rf $(INCLUDEDIR)
+ mkdir $(INCLUDEDIR) $(INCLUDEDIR)/util $(INCLUDEDIR)/thread $(INCLUDEDIR)/interface $(INCLUDEDIR)/storage $(INCLUDEDIR)/algorithm $(INCLUDEDIR)/cache
+ cp algorithm/*.h $(INCLUDEDIR)/algorithm
+ cp cache/*.h $(INCLUDEDIR)/cache
+ cp include/kingdb/*.h $(INCLUDEDIR)
+ cp interface/*.h $(INCLUDEDIR)/interface
+ cp util/*.h $(INCLUDEDIR)/util
+ cp thread/*.h $(INCLUDEDIR)/thread
+ cp storage/*.h $(INCLUDEDIR)/storage
+
.cc.o:
$(CC) $(CFLAGS) $(INCLUDES) $< -o $@
@@ -8,8 +8,6 @@
#include "util/debug.h"
#include <inttypes.h>
-#include "kingdb/kdb.h"
-
namespace kdb {
class RateLimiter {
@@ -15,11 +15,11 @@
#include <chrono>
#include <ctime>
-#include "cache/rate_limiter.h"
-#include "kingdb/kdb.h"
-#include "util/order.h"
-#include "util/byte_array.h"
#include "util/options.h"
+#include "util/byte_array.h"
+#include "util/order.h"
+#include "cache/rate_limiter.h"
+#include "thread/event_manager.h"
namespace kdb {
View
@@ -5,18 +5,13 @@
#ifndef KINGDB_HEADERS_H_
#define KINGDB_HEADERS_H_
-#include "util/logger.h"
+#include "util/byte_array.h"
#include "util/status.h"
-#include "util/order.h"
-#include "thread/event_manager.h"
-
-namespace kdb {
-
-static const uint32_t kVersionMajor = 0;
-static const uint32_t kVersionMinor = 9;
-static const uint32_t kVersionRevision = 0;
-static const uint32_t kVersionBuild = 0;
-
-} // namespace kdb
+#include "util/options.h"
+#include "interface/kingdb.h"
+#include "interface/database.h"
+#include "interface/snapshot.h"
+#include "interface/iterator.h"
+#include "interface/multipart.h"
#endif // KINGDB_HEADERS_H_
View
@@ -19,7 +19,6 @@
#include "util/status.h"
#include "util/logger.h"
#include "thread/threadpool.h"
-#include "kingdb/kdb.h"
#define SIZE_BUFFER_CLIENT 1024*1024*1 // used by client to get data from server
#define SIZE_LARGE_TEST_ITEMS 1024*1024*1 // size of large items used for testing
View
@@ -29,7 +29,6 @@
#include <string>
#include <chrono>
-#include "kingdb/kdb.h"
#include "thread/threadpool.h"
#include "interface/database.h"
#include "interface/multipart.h"
@@ -5,14 +5,18 @@
#include <execinfo.h>
#include <csignal>
-#include "include/kingdb/kdb.h"
#include "network/server.h"
#include "thread/threadpool.h"
#include "util/logger.h"
#include "util/options.h"
#include "util/file.h"
#include "util/config_parser.h"
+static const uint32_t kVersionServerMajor = 0;
+static const uint32_t kVersionServerMinor = 9;
+static const uint32_t kVersionServerRevision = 0;
+static const uint32_t kVersionServerBuild = 0;
+
bool stop_requested = false;
void termination_signal_handler(int signal) {
@@ -111,8 +115,8 @@ int main(int argc, char** argv) {
kdb::ServerOptions::AddParametersToConfigParser(server_options, parser);
if (argc == 2 && (strncmp(argv[1], "--help", 6) == 0 || strncmp(argv[1], "-h", 2) == 0)) {
- fprintf(stdout, "KingDB is a persisted key-value store. For more information, visit http://kingdb.org\n");
- fprintf(stdout, "Software version %d.%d.%d\nData format version %d.%d\n", kdb::kVersionMajor, kdb::kVersionMinor, kdb::kVersionRevision, kdb::kVersionDataFormatMajor, kdb::kVersionDataFormatMinor);
+ fprintf(stdout, "KingServer is a persisted key-value database server, which uses the KingDB library\nas a storage backend. For more information, visit http://kingdb.org\n");
+ fprintf(stdout, "KingServer version: %d.%d.%d\nKingDB version: %d.%d.%d\nData format version: %d.%d\n", kVersionServerMajor, kVersionServerMinor, kVersionServerRevision, kdb::kVersionMajor, kdb::kVersionMinor, kdb::kVersionRevision, kdb::kVersionDataFormatMajor, kdb::kVersionDataFormatMinor);
fprintf(stdout, "\nParameters:\n\n");
parser.PrintUsage();
exit(0);
View
@@ -16,7 +16,7 @@
#include <string.h>
#include <inttypes.h>
-#include "include/kingdb/kdb.h"
+#include "util/version.h"
#include "util/logger.h"
#include "util/status.h"
#include "algorithm/coding.h"
@@ -24,7 +24,6 @@
#include <errno.h>
#include <dirent.h>
-#include "kingdb/kdb.h"
#include "util/options.h"
#include "util/order.h"
#include "util/byte_array.h"
@@ -25,12 +25,11 @@
#include <errno.h>
#include <dirent.h>
-#include "kingdb/kdb.h"
-#include "util/options.h"
-#include "algorithm/hash.h"
#include "util/byte_array.h"
-#include "algorithm/crc32c.h"
#include "util/file.h"
+#include "util/options.h"
+#include "algorithm/crc32c.h"
+#include "algorithm/hash.h"
namespace kdb {
@@ -25,7 +25,7 @@
#include <errno.h>
#include <dirent.h>
-#include "kingdb/kdb.h"
+#include "util/version.h"
#include "util/options.h"
#include "util/order.h"
#include "util/byte_array.h"
@@ -35,6 +35,7 @@
#include "storage/format.h"
#include "storage/resource_manager.h"
#include "storage/hstable_manager.h"
+#include "thread/event_manager.h"
namespace kdb {
@@ -10,7 +10,6 @@
#include <condition_variable>
#include <vector>
#include <map>
-#include "kingdb/kdb.h"
namespace kdb {
View
@@ -11,6 +11,7 @@
#include <condition_variable>
#include <queue>
#include <vector>
+#include <map>
namespace kdb {
@@ -19,7 +19,6 @@
#include <gperftools/profiler.h>
#include "interface/database.h"
-#include "kingdb/kdb.h"
#include "util/status.h"
#include "util/order.h"
#include "util/byte_array.h"
View
@@ -19,7 +19,6 @@
#include "util/file.h"
#include "util/logger.h"
-#include "util/logger.h"
#include "util/options.h"
#include "algorithm/compressor.h"
#include "algorithm/crc32c.h"
View
@@ -18,6 +18,7 @@
#include <memory>
#include "util/status.h"
+#include "util/logger.h"
namespace kdb {
View
@@ -0,0 +1,17 @@
+// Copyright (c) 2014, Emmanuel Goossaert. All rights reserved.
+// Use of this source code is governed by the BSD 3-Clause License,
+// that can be found in the LICENSE file.
+
+#ifndef KINGDB_VERSION_H_
+#define KINGDB_VERSION_H_
+
+namespace kdb {
+
+static const uint32_t kVersionMajor = 0;
+static const uint32_t kVersionMinor = 9;
+static const uint32_t kVersionRevision = 0;
+static const uint32_t kVersionBuild = 0;
+
+} // namespace kdb
+
+#endif // KINGDB_VERSION_H_

0 comments on commit f5261fd

Please sign in to comment.