added static library output

pull/1/head
Avril 4 years ago
parent 4ed44555f3
commit fe3dcf3681
Signed by: flanchan
GPG Key ID: 284488987C31F630

@ -8,7 +8,7 @@ license = "GPL-3.0-or-later"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib] [lib]
crate-type = ["cdylib"] crate-type = ["cdylib", "staticlib"]
[profile.release] [profile.release]
opt-level = 3 opt-level = 3

@ -19,10 +19,12 @@ test:
install: install:
cp -f ./target/release/libkhash.so $(INSTALL)/libkhash.so cp -f ./target/release/libkhash.so $(INSTALL)/libkhash.so
cp -f ./target/release/libkhash.a $(INSTALL)/libkhash.a
cp -f $(CLI)/build/kana-hash $(INSTALL-BIN)/kana-hash cp -f $(CLI)/build/kana-hash $(INSTALL-BIN)/kana-hash
cp -f include/khash.h $(INSTALL-INCLUDE)/khash.h cp -f include/khash.h $(INSTALL-INCLUDE)/khash.h
uninstall: uninstall:
rm -f $(INSTALL)/libkana_hash.so rm -f $(INSTALL)/libkhash.so
rm -f $(INSTALL)/libkhash.a
rm -f $(INSTALL-BIN)/kana-hash rm -f $(INSTALL-BIN)/kana-hash
rm -f $(INSTALL-INCLUDE)/khash.h rm -f $(INSTALL-INCLUDE)/khash.h

@ -11,10 +11,10 @@
| SHA256 (truncated) | おシソまツアで | | SHA256 (truncated) | おシソまツアで |
** Installation ** Installation
The dynamic library is built with ~Cargo~ and ~Rust~, and the cli example program is built with ~gcc~. The dynamic library is built with ~Cargo~ and ~Rust~, and the CLI example program is built with ~gcc~.
*** Build and install *** Build and install
The default build configuration builds both the dynamic library and the cli example program, and copies them to =/usr/lib/libkhash.so= and =/usr/bin/kana-hash= respectively. The default build configuration builds both the dynamic library, static library, and the CLI example program and copies them to =/usr/local/lib/libkhash.so=, =/usr/local/lib/libkhash.a= and =/usr/local/bin/kana-hash= respectively. Also installed is the C header to =/usr/local/include/khash.h=.
#+BEGIN_SRC shell #+BEGIN_SRC shell
$ make && sudo make install $ make && sudo make install
@ -33,8 +33,8 @@
The Makefile contains some other build directives. The Makefile contains some other build directives.
**** Native code optimisations **** Native code optimisations
By default =libkhash= builds the shared library with native architecture optimisations enabled. By default =libkhash= builds the shared and static library with native architecture optimisations enabled.
If you are intending to move the binary to another architecture, this might not be desireable. If you are intending to move the libraries to another architecture, this might not be desireable.
To build without such optimisations, run: To build without such optimisations, run:
#+BEGIN_SRC shell #+BEGIN_SRC shell

Loading…
Cancel
Save