diff --git a/b2sum/README.md b/b2sum/README.md new file mode 100644 index 0000000..1fdaa17 --- /dev/null +++ b/b2sum/README.md @@ -0,0 +1,12 @@ +# b2sum # + +This is a simple tool to create BLAKE2 hashes of files or streams. For more usage information refer to the manpage, e.g., `man b2sum.1`. + +## Building and Installing ## + +To build `b2sum`, just run `make`. To install, run `make install`. The install path can be altered using the `PREFIX` variable, which defaults to `/usr/local`. Use `PREFIX=/some/path make install` to install somewhere else. + +`b2sum` makes use of OpenMP by default. Some compilers do not support this technology, in which case `b2sum` can be built without it using the `NO_OPENMP` variable. Use `NO_OPENMP=1 make` to build without OpenMP. + +For OS X, there is a prebuilt [Homebrew formula](https://github.com/Homebrew/homebrew-core/commit/e016cda47dfa298c6628de3e9d0fd976eecd91be) which may be installed with `brew install b2sum`. + diff --git a/b2sum/makefile b/b2sum/makefile index 164cb26..4d19474 100644 --- a/b2sum/makefile +++ b/b2sum/makefile @@ -1,9 +1,13 @@ PROG=b2sum PREFIX?=/usr/local MANDIR?=$(PREFIX)/man +NO_OPENMP?=0 +NO_OPENMP_0=-fopenmp +NO_OPENMP_1= CC?=gcc -CFLAGS?=-O3 -march=native -static -CFLAGS+=-I../sse -fopenmp +CFLAGS?=-O3 -march=native -Werror=declaration-after-statement +CFLAGS+=-std=c99 -I../sse +CFLAGS+=$(NO_OPENMP_$(NO_OPENMP)) LIBS= #FILES=b2sum.c ../ref/blake2b-ref.c ../ref/blake2s-ref.c ../ref/blake2bp-ref.c ../ref/blake2sp-ref.c FILES=b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c