34 lines
818 B
Makefile
34 lines
818 B
Makefile
CROSS_COMPILE ?=
|
|
CC := $(CROSS_COMPILE)gcc
|
|
STRIP := $(CROSS_COMPILE)strip
|
|
CFLAGS = -Wall -g -O3
|
|
LIB = -lssh2 -pthread
|
|
forward-tunnel = forward-tunnel
|
|
reverse-tunnel = reverse-tunnel
|
|
|
|
ifeq ($(shell uname -o), GNU/Linux)
|
|
ifeq ($(shell lsb_release -si), Debian)
|
|
LIB += -static
|
|
SSH2_LIB := $(shell pkg-config --static --libs --cflags libssh2)
|
|
else
|
|
SSH2_LIB := $(shell pkg-config --libs --cflags libssh2)
|
|
endif
|
|
endif
|
|
|
|
all:forward-tunnel reverse-tunnel
|
|
|
|
forward-tunnel: forward-tunnel.o thpool.o
|
|
$(CC) $(CFLAGS) -o $(forward-tunnel) $^ $(SSH2_LIB) $(LIB)
|
|
$(STRIP) forward-tunnel
|
|
|
|
reverse-tunnel: reverse-tunnel.o
|
|
$(CC) $(CFLAGS) -o $(reverse-tunnel) $^ $(SSH2_LIB) $(LIB)
|
|
: $(STRIP) reverse-tunnel
|
|
|
|
.c.o:
|
|
$(CC) $(CFLAGS) -c $<
|
|
|
|
clean:
|
|
rm -rf *.o
|
|
rm reverse-tunnel forward-tunnel
|