aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
-rw-r--r--Makefile12
-rw-r--r--README.md7
m---------ext/libhydrogen0
4 files changed, 14 insertions, 8 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..ade3b37
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "ext/libhydrogen"]
+ path = ext/libhydrogen
+ url = https://github.com/jedisct1/libhydrogen
diff --git a/Makefile b/Makefile
index 4656bfd..ff50b37 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,14 @@
PREFIX ?= /usr/local
WFLAGS ?= -Wall -Wextra -Wmissing-prototypes -Wdiv-by-zero -Wbad-function-cast -Wcast-align -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wnested-externs -Wno-unknown-pragmas -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-enum -Wno-type-limits
CFLAGS ?= -Os -march=native -fno-exceptions $(WFLAGS)
-CFLAGS += -I.
-OBJ = src/encpipe.o src/safe_rw.o
+CFLAGS += -I. -Iext/libhydrogen
+OBJ = ext/libhydrogen/hydrogen.o src/encpipe.o src/safe_rw.o
AR ?= ar
RANLIB ?= ranlib
STRIP ?= strip
SRC = \
+ ext/libhydrogen/hydrogen.c \
src/common.h \
src/encpipe.c \
src/encpipe_p.h \
@@ -19,7 +20,7 @@ all: bin
bin: encpipe
encpipe: $(OBJ)
- $(CC) $(CFLAGS) -o encpipe $(OBJ) -lhydrogen
+ $(CC) $(CFLAGS) -o encpipe $(OBJ)
install: bin
-$(STRIP) encpipe 2> /dev/null
@@ -31,7 +32,12 @@ uninstall:
$(OBJ): $(SRC)
+ext/libhydrogen/hydrogen.c:
+ git submodule update --init
+
.PHONY: clean
clean:
rm -f encpipe $(OBJ)
+
+distclean: clean
diff --git a/README.md b/README.md
index b2edd16..e784d69 100644
--- a/README.md
+++ b/README.md
@@ -29,11 +29,8 @@ encpipe -e -p password -i /etc/passwd | nc 127.0.0.1 6666
# Dependencies
-[libhydrogen](https://github.com/jedisct1/libhydrogen) - Install with
-`make install`
-
-The library gets statically linked, so the resulting binary doesn't
-have any dependencies besides the standard C library.
+None. It includes [libhydrogen](https://github.com/jedisct1/libhydrogen) as
+a submodule. There is nothing to install.
# Installation
diff --git a/ext/libhydrogen b/ext/libhydrogen
new file mode 160000
+Subproject c223fbeeec7aa621d21ddd83ed41de8569eaa88