summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyo Nakamura <upa@haeena.net>2022-10-30 17:58:56 +0900
committerRyo Nakamura <upa@haeena.net>2022-10-30 17:58:56 +0900
commit2bcbdd2292a24c90331c3c481984363d4d51c2b5 (patch)
tree5fa43e44b61dda409d069061b5cd1274025253e1
parentabd6bf2bbfb3b6dd0a0d3a7d3109eaa95a647f17 (diff)
add install to cmake
-rw-r--r--CMakeLists.txt5
-rw-r--r--README.md16
2 files changed, 14 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3ef53c2..2688928 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,3 +8,8 @@ add_executable(mscp src/main.c src/platform.c src/ssh.c src/file.c src/pprint.c)
target_include_directories(mscp PUBLIC ./src /usr/local/include)
target_link_directories(mscp PUBLIC /usr/local/lib)
target_link_libraries(mscp ssh pthread m)
+
+
+install(TARGETS mscp
+ RUNTIME DESTINATION bin
+)
diff --git a/README.md b/README.md
index 04bae2a..71a58a4 100644
--- a/README.md
+++ b/README.md
@@ -28,21 +28,23 @@ Clone and build this repositoy.
```console
git clone https://github.com/upa/mscp.git
-
cd mscp
+
mkdir build
cd build
cmake ..
make
-```
+# install the mscp binary to CMAKE_INSTALL_PREFIX/bin (usually /usr/local/bin)
+make install
+```
## Run
- Usage
```shell-session
-./mscp -h
+$ mscp -h
mscp: copy files over multiple ssh connections
Usage: mscp [CvqDdh] [-n nr_conns] [-s min_chunk_sz] [-S max_chunk_sz]
@@ -74,7 +76,7 @@ Usage: mscp [CvqDdh] [-n nr_conns] [-s min_chunk_sz] [-S max_chunk_sz]
- Two Intel Xeon Gold 6130 machines directly connected with Intel E810 100Gbps NICs.
```shell-session
-$ ./mscp /tmp/test.img 10.0.0.1:/tmp/
+$ mscp /tmp/test.img 10.0.0.1:/tmp/
[===============================================================] 100% 8GB/8GB 3.02GB/s
$
```
@@ -82,10 +84,10 @@ $
- `-v` options increment verbose output level.
```shell-session
-$ ./mscp test 10.0.0.1:
+$ mscp test 10.0.0.1:
[===============================================================] 100% 13B/13B 2.41KB/s
-$ ./mscp -v test 10.0.0.1:
+$ mscp -v test 10.0.0.1:
file test/test.txt (local) -> ./test/test.txt (remote) 9B
file test/test2/2.txt (local) -> ./test/test2/2.txt (remote) 2B
file test/1.txt (local) -> ./test/1.txt (remote) 2B
@@ -97,7 +99,7 @@ copy done: test/test2/2.txt
copy done: test/test.txt
[===============================================================] 100% 13B/13B 2.51KB/s
-$ ./mscp -vv -n 4 test 10.0.0.1:
+$ mscp -vv -n 4 test 10.0.0.1:
connecting to 10.0.0.1 for checking destinations...
file test/test.txt (local) -> ./test/test.txt (remote) 9B
file test/test2/2.txt (local) -> ./test/test2/2.txt (remote) 2B