aboutsummaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
authorJulien Dessaux2018-05-22 17:31:56 +0200
committerJulien Dessaux2018-05-22 17:31:56 +0200
commite840c061817a797fae31a14796a790b0c979e43f (patch)
treea64752420ae1b7a91e43e4d4314b5df9f8609313 /GNUmakefile
downloadbastion-e840c061817a797fae31a14796a790b0c979e43f.tar.gz
bastion-e840c061817a797fae31a14796a790b0c979e43f.tar.bz2
bastion-e840c061817a797fae31a14796a790b0c979e43f.zip
Initial import with working simple server based on libssh examples
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile26
1 files changed, 26 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..f6e0f7c
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,26 @@
+CC=clang
+DEBUG=-g
+CFLAGS= ${DEBUG} -Wall -Werror -Wextra
+
+sources=$(wildcard src/*.c)
+OBJ=$(sources:.c=.o)
+
+all: bastion
+
+bastion: $(OBJ)
+ $(CC) ${DEBUG} -o bastion $(OBJ) -lssh -lpthread -lssh_threads -lutil
+
+clean:
+ $(RM) bastion *.[do] src/*.[do]
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) $*.c -o $*.o
+ $(CC) -MM $(CFLAGS) $*.c > $*.d
+ @mv -f $*.d $*.d.tmp
+ @sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
+ @sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
+ @rm -f $*.d.tmp
+
+valgrind:
+ valgrind --leak-check=full --show-leak-kinds=all --suppressions=$HOME/.valgrind_suppressions ./bastion
+ #valgrind -v --leak-check=full --show-leak-kinds=all --suppressions=$HOME/.valgrind_suppressions --gen-suppressions=yes ./bastion