Skip to content

Commit

Permalink
Install manpage and add it to the release tarball
Browse files Browse the repository at this point in the history
Signed-off-by: Steffen Jaeckel <[email protected]>
  • Loading branch information
sjaeckel committed Jun 21, 2023
1 parent 733cb22 commit 565a89b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion doc/tommath.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH LIBTOMMATH 3 "2023-04-26"
.TH LIBTOMMATH 3 "2003-28-02"
.SH NAME
libtommath - a big integer library
.SH SYNOPSIS
Expand Down
9 changes: 3 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ profiled_single: amalgamated_timing
$(CC) $(LTM_CFLAGS) -fbranch-probabilities -c pre_gen/tommath_amalgam.c -o tommath_amalgam.o
$(AR) $(ARFLAGS) $(LIBNAME) tommath_amalgam.o

install: $(LIBNAME)
install -d $(DESTDIR)$(LIBPATH)
install -d $(DESTDIR)$(INCPATH)
install: $(LIBNAME) .install_common
install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)

Expand Down Expand Up @@ -114,9 +112,6 @@ tune: $(LIBNAME)
coveralls: lcov
coveralls-lcov

docs manual:
$(MAKE) -C doc/ $@ V=$(V)

.PHONY: pre_gen cmp
pre_gen:
mkdir -p pre_gen
Expand All @@ -127,6 +122,7 @@ cmp: profiled_single
./timing
$(MAKE) -C logs/ cmp

TODAY=$(shell date -I)
zipup: clean astyle new_file docs
@# Update the index, so diff-index won't fail in case the pdf has been created.
@# As the pdf creation modifies the tex files, git sometimes detects the
Expand All @@ -140,6 +136,7 @@ zipup: clean astyle new_file docs
-@(find libtommath-$(VERSION)/ -type f | xargs grep 'FIXM[E]') && echo '############## BEWARE: the "fixme" marker was found !!! ##############' || true
mkdir -p libtommath-$(VERSION)/doc
cp doc/bn.pdf libtommath-$(VERSION)/doc/
sed -e "s,^Version.*,Version $(VERSION)," -e "s,2003-28-02,$(TODAY)," doc/tommath.3 > libtommath-$(VERSION)/doc/tommath.3
$(MAKE) -C libtommath-$(VERSION)/ pre_gen
tar -c libtommath-$(VERSION)/ | xz -6e -c - > ltm-$(VERSION).tar.xz
zip -9rq ltm-$(VERSION).zip libtommath-$(VERSION)
Expand Down
4 changes: 1 addition & 3 deletions makefile.shared
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ LOBJECTS = $(OBJECTS:.o=.lo)
$(LIBNAME): $(OBJECTS)
$(LTLINK) $(LTM_LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO) $(LTM_LIBTOOLFLAGS)

install: $(LIBNAME)
install -d $(DESTDIR)$(LIBPATH)
install -d $(DESTDIR)$(INCPATH)
install: $(LIBNAME) .install_common
$(LIBTOOL) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' -e 's,@CMAKE_INSTALL_LIBDIR@,lib,' \
Expand Down
16 changes: 16 additions & 0 deletions makefile_include.mk
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,27 @@ HEADERS=tommath_private.h tommath_class.h tommath_superclass.h tommath_cutoffs.h
#LIBPATH The directory for libtommath to be installed to.
#INCPATH The directory to install the header files for libtommath.
#DATAPATH The directory to install the pdf docs.
#MANPATH The directory to install the manfile.
DESTDIR ?=
PREFIX ?= /usr/local
LIBPATH ?= $(PREFIX)/lib
INCPATH ?= $(PREFIX)/include
DATAPATH ?= $(PREFIX)/share/doc/libtommath/pdf
MANPATH ?= $(PREFIX)/share/man/

.install_common:
install -d $(DESTDIR)$(LIBPATH)
install -d $(DESTDIR)$(INCPATH)

install_docs: manual
install -d $(DESTDIR)$(DATAPATH)
install -p -m 644 doc/bn.pdf $(DESTDIR)$(DATAPATH)
install -d $(DESTDIR)$(MANPATH)
install -p -m 644 doc/tommath.3 $(DESTDIR)$(MANPATH)/man3


docs manual:
$(MAKE) -C doc/ $@ V=$(V)

# build & run test-suite
check: test
Expand Down

0 comments on commit 565a89b

Please sign in to comment.