]> git.codecow.com Git - Monocypher.git/commitdiff
Generate docks with `make all`
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 26 Feb 2023 10:10:48 +0000 (11:10 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 26 Feb 2023 10:34:06 +0000 (11:34 +0100)
That way the docs no longer have to belong to root when we generate
them.  Some more dist.sh shenanigans were required to spare tarball
users the mandoc dependency.  Mostly making sure their doc is not
deleted when they `make clean`.

dist.sh
dist_ignore
makefile

diff --git a/dist.sh b/dist.sh
index c8f36158c9489e2069b068d29ae42492e8943902..d85c07d6eeeebd9eea25058c8e0396a68fb5dc8b 100755 (executable)
--- a/dist.sh
+++ b/dist.sh
@@ -74,8 +74,10 @@ find $FOLDER -type f -exec sed -i "s/__git__/$VERSION/g" \{\} \;
 
 # Remove the dist target from the makefile (no recursive releases!),
 # and the tests/vector.h target, which ships with the tarball.
-sed -i '/# Remove lines below for the tarball/,$d' $FOLDER/makefile
-sed -i 's/clean uninstall dist/clean uninstall/'   $FOLDER/makefile
+sed -i '/# Remove lines below for the tarball/,$d'      $FOLDER/makefile
+sed -i 's/clean uninstall dist/clean uninstall/'        $FOLDER/makefile
+sed -i 's| doc/man3/intro.3monocypher||'                $FOLDER/makefile
+sed -i 's|rm -rf lib/ doc/html/ doc/man3/|rm -rf lib/|' $FOLDER/makefile
 
 # Remove contributor notes from the README
 sed -e '/Contributor notes/,$d' \
index 931556f3378fa0404ed0f2a8e61137d0afb6c2fb..2be2413efdebf592b7809673f7a70a7432b2467b 100644 (file)
@@ -33,6 +33,5 @@ lib*
 dist.sh
 dist_ignore
 tests/gen*
-doc/*.sh
 tis.config
 tests/tis-ci-gen-config.sh
index b86bbc84ce6e5714702c059f55a5bd7766dc5281..5651c24b1cc3b07202383a127a9a5d3bd52b8189 100644 (file)
--- a/makefile
+++ b/makefile
@@ -70,7 +70,7 @@ SONAME=libmonocypher.so.3
 ##################
 ## Main targets ##
 ##################
-all  : library
+all  : library doc/man3/intro.3monocypher
 check: test
 
 test: test.out
@@ -83,7 +83,7 @@ ctgrind: ctgrind.out
        valgrind ./ctgrind.out
 
 clean:
-       rm -rf lib/
+       rm -rf lib/ doc/html/ doc/man3/
        rm -f *.out
 
 #############
@@ -99,8 +99,7 @@ install: library src/monocypher.h monocypher.pc install-doc
        sed "s|PREFIX|$(PREFIX)|"  monocypher.pc \
             > $(DESTDIR)/$(PKGCONFIGDIR)/monocypher.pc
 
-install-doc:
-       doc/doc_gen.sh
+install-doc: doc/man3/intro.3monocypher
        mkdir -p $(DESTDIR)/$(MANDIR)
        cp -PR doc/man3/*.3monocypher $(DESTDIR)/$(MANDIR)
 
@@ -194,5 +193,15 @@ tests/vectors.h:
        @echo ""
        exit 1
 
+doc/man3/intro.3monocypher: \
+       doc/crypto_aead_lock.3monocypher     doc/crypto_argon2.3monocypher       \
+       doc/crypto_blake2b.3monocypher       doc/crypto_chacha20_djb.3monocypher \
+       doc/crypto_ed25519_sign.3monocypher  doc/crypto_eddsa_sign.3monocypher   \
+       doc/crypto_elligator_map.3monocypher doc/crypto_poly1305.3monocypher     \
+       doc/crypto_sha512.3monocypher        doc/crypto_verify16.3monocypher     \
+       doc/crypto_wipe.3monocypher          doc/crypto_x25519.3monocypher       \
+       doc/intro.3monocypher
+       doc/doc_gen.sh
+
 dist: tests/vectors.h
        ./dist.sh