From 482dd467fc82bb5281c7b097228247256b8d18ed Mon Sep 17 00:00:00 2001 From: yedongfu Date: Thu, 18 Apr 2019 11:17:43 +0800 Subject: [PATCH] Quick Start first --- README-en.md | 66 +++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/README-en.md b/README-en.md index 1912f61..460b670 100644 --- a/README-en.md +++ b/README-en.md @@ -27,37 +27,10 @@ can use valgrind to check memory leak only 10 lines can finish a complete server ## Usage -### Build handy shared library and examples: -``` -$ git clone https://github.com/yedf/handy -$ cd handy && mkdir build && cd build -$ cmake -DBUILD_HANDY_SHARED_LIBRARY=ON -DBUILD_HANDY_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=/tmp/handy .. -$ make -j4 -$ make install -$ ls /tmp/handy -bin include lib64 -$ ls /tmp/handy/bin/ -10m-cli 10m-svr codec-cli codec-svr daemon echo hsha http-hello idle-close reconnect safe-close stat timer udp-cli udp-hsha udp-svr write-on-empty -$ ls /tmp/handy/lib64/ -libhandy_s.a libhandy.so -``` - -### As a static library in your own programs: -* add handy as a git submodule to say a folder called vendor -* in your CMakeLists.txt +### Quick start ``` -add_subdirectory("vendor/handy" EXCLUDE_FROM_ALL) - -add_executable(${PROJECT_NAME} main.cpp) - -target_include_directories(${PROJECT_NAME} PUBLIC - "vendor/handy" -) - -target_link_libraries(${PROJECT_NAME} PUBLIC - handy_s -) + make && make install ``` ### sample --echo-server @@ -103,6 +76,41 @@ examples can be found in directory protobuf ###[hand book](https://github.com/yedf/handy/blob/master/doc-cn.md) +## Advanced build option + +### Build handy shared library and examples: +``` +$ git clone https://github.com/yedf/handy +$ cd handy && mkdir build && cd build +$ cmake -DBUILD_HANDY_SHARED_LIBRARY=ON -DBUILD_HANDY_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=/tmp/handy .. +$ make -j4 +$ make install +$ ls /tmp/handy +bin include lib64 +$ ls /tmp/handy/bin/ +10m-cli 10m-svr codec-cli codec-svr daemon echo hsha http-hello idle-close reconnect safe-close stat timer udp-cli udp-hsha udp-svr write-on-empty +$ ls /tmp/handy/lib64/ +libhandy_s.a libhandy.so +``` + +### As a static library in your own programs: +* add handy as a git submodule to say a folder called vendor +* in your CMakeLists.txt + +``` +add_subdirectory("vendor/handy" EXCLUDE_FROM_ALL) + +add_executable(${PROJECT_NAME} main.cpp) + +target_include_directories(${PROJECT_NAME} PUBLIC + "vendor/handy" +) + +target_link_libraries(${PROJECT_NAME} PUBLIC + handy_s +) +``` + license ==== Use of this source code is governed by a BSD-style