Skip to content

Commit

Permalink
Source: split code into new directories: mk_bin, mk_server & mk_core
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Silva <eduardo@monkey.io>
  • Loading branch information
edsiper committed Jun 7, 2015
1 parent 67278ac commit 2d09462
Show file tree
Hide file tree
Showing 47 changed files with 23 additions and 29 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -23,3 +23,5 @@ lib/python/bin/*
lib/python/conf/*
lib/python/jemalloc.config
src/include/
build/
include/monkey/mk_static_plugins.h
30 changes: 21 additions & 9 deletions CMakeLists.txt
Expand Up @@ -290,16 +290,28 @@ configure_file(


# General Headers
include_directories(include/)
include_directories(src/)

add_subdirectory(plugins/)
include_directories(./)
include_directories(include)
include_directories(monkey)

# Instruct CMake to build the the code base
# =========================================
# plugins : plugins for mk_server
# mk_core : generic utilities
# mk_server: server code base: plugins, protocols, scheduler.. (no executable)
# mk_bin : server executable
#
add_subdirectory(plugins)
add_subdirectory(mk_core)
add_subdirectory(mk_server)
if(NOT WITHOUT_BIN)
add_subdirectory(mk_bin)
endif()

# Instruct CMake to build the Monkey Core
add_subdirectory(src/)
add_subdirectory(conf/)
add_subdirectory(htdocs/)
add_subdirectory(include/)
# Configuration, headers generation and others
add_subdirectory(conf)
add_subdirectory(htdocs)
add_subdirectory(include)

# Install (missings ?) paths
install(DIRECTORY DESTINATION ${MK_PATH_LOG})
Expand Down
2 changes: 0 additions & 2 deletions src/monkey.c → mk_bin/monkey.c
Expand Up @@ -47,8 +47,6 @@ static const char MONKEY_BUILT[] = __DATE__ " " __TIME__;
static const char MONKEY_BUILT[] = "Unknown";
#endif

const mk_ptr_t mk_monkey_protocol = mk_ptr_init(MK_HTTP_PROTOCOL_11_STR);

void mk_thread_keys_init(void)
{
/* Create thread keys */
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 0 additions & 18 deletions src/CMakeLists.txt → mk_server/CMakeLists.txt
Expand Up @@ -20,10 +20,6 @@ set(src
)


add_subdirectory(mk_core)

include_directories(./)

# Always build a static library, thats our core :)
add_library(monkey-core-static STATIC ${src})
set_target_properties(monkey-core-static PROPERTIES OUTPUT_NAME monkey)
Expand All @@ -37,17 +33,3 @@ endif()
if(WITH_LINUX_KQUEUE)
target_link_libraries(monkey-core-static kqueue)
endif()

# Build the binary
if(NOT WITHOUT_BIN)
add_executable(monkey-bin monkey.c)
target_link_libraries(monkey-bin monkey-core-static)
set_target_properties(monkey-bin PROPERTIES OUTPUT_NAME monkey)
endif()


if(BUILD_LOCAL)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/")
else()
install(TARGETS monkey-bin RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_SBINDIR})
endif()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 2d09462

Please sign in to comment.