Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional path specification to libssh.h, and instruction to use brew (for Mac) #25

Merged
merged 2 commits into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# See https://github.com/spook/sshping

LIBSSH_INCLUDE ?= /usr/include/libssh/libssh.h
LIBSSH_INCLUDE2 = /usr/local/include/libssh/libssh.h

ifeq ($(wildcard $(LIBSSH_INCLUDE)),)
LIBSSH_INCLUDE = $(LIBSSH_INCLUDE2)
endif

.PHONY=default sshping man

default: sshping

sshping: bin/sshping

bin/sshping: src/sshping.cxx /usr/include/libssh/libssh.h
bin/sshping: src/sshping.cxx $(LIBSSH_INCLUDE)
g++ -Wall -I ext/ -o bin/sshping src/sshping.cxx -lssh

/usr/include/libssh/libssh.h:
$(LIBSSH_INCLUDE):
echo '*** Please install libssh-dev, libssh-devel, or similar package'
exit 2

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,21 @@ Install the libssh-dev (or libssh-devel) package, version 0.6 or later:
sudo apt-get install libssh-dev
...or
sudo yum install libssh-devel
...or
brew install libssh
...or whatever works on your platform

From the main directory (where this README.md file is located), run 'make':

cd sshping
make

By default, `/usr/include/libssh/libssh.h` and `/usr/local/include/libssh/libssh.h` will be searched to locate `libssh.h`.
Optionally, specify a path to `libssh.h` with `LIBSSH_INCLUDE` variable:

cd sshping
make -e LIBSSH_INCLUDE=/path/to/libssh/libssh.h

The resultant binary will be in the bin/ directory. You may copy this to
your system binary location, for example:

Expand Down