Skip to content

Commit e762449

Browse files
committed
Install manpage and add it to the release tarball
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 733cb22 commit e762449

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

doc/tommath.3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH LIBTOMMATH 3 "2023-04-26"
1+
.TH LIBTOMMATH 3 "2003-28-02"
22
.SH NAME
33
libtommath - a big integer library
44
.SH SYNOPSIS

makefile

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ profiled_single: amalgamated_timing
7979
$(CC) $(LTM_CFLAGS) -fbranch-probabilities -c pre_gen/tommath_amalgam.c -o tommath_amalgam.o
8080
$(AR) $(ARFLAGS) $(LIBNAME) tommath_amalgam.o
8181

82-
install: $(LIBNAME)
83-
install -d $(DESTDIR)$(LIBPATH)
84-
install -d $(DESTDIR)$(INCPATH)
82+
install: $(LIBNAME) .install_common
8583
install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)
8684
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
8785

@@ -114,9 +112,6 @@ tune: $(LIBNAME)
114112
coveralls: lcov
115113
coveralls-lcov
116114

117-
docs manual:
118-
$(MAKE) -C doc/ $@ V=$(V)
119-
120115
.PHONY: pre_gen cmp
121116
pre_gen:
122117
mkdir -p pre_gen
@@ -127,6 +122,7 @@ cmp: profiled_single
127122
./timing
128123
$(MAKE) -C logs/ cmp
129124

125+
TODAY=$(shell date -I)
130126
zipup: clean astyle new_file docs
131127
@# Update the index, so diff-index won't fail in case the pdf has been created.
132128
@# As the pdf creation modifies the tex files, git sometimes detects the
@@ -140,6 +136,7 @@ zipup: clean astyle new_file docs
140136
-@(find libtommath-$(VERSION)/ -type f | xargs grep 'FIXM[E]') && echo '############## BEWARE: the "fixme" marker was found !!! ##############' || true
141137
mkdir -p libtommath-$(VERSION)/doc
142138
cp doc/bn.pdf libtommath-$(VERSION)/doc/
139+
sed -e "s,^Version.*,Version $(VERSION)," -e "s,2003-28-02,$(TODAY)," doc/tommath.3 > libtommath-$(VERSION)/doc/tommath.3
143140
$(MAKE) -C libtommath-$(VERSION)/ pre_gen
144141
tar -c libtommath-$(VERSION)/ | xz -6e -c - > ltm-$(VERSION).tar.xz
145142
zip -9rq ltm-$(VERSION).zip libtommath-$(VERSION)

makefile.shared

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ LOBJECTS = $(OBJECTS:.o=.lo)
6060
$(LIBNAME): $(OBJECTS)
6161
$(LTLINK) $(LTM_LDFLAGS) $(LOBJECTS) -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_SO) $(LTM_LIBTOOLFLAGS)
6262

63-
install: $(LIBNAME)
64-
install -d $(DESTDIR)$(LIBPATH)
65-
install -d $(DESTDIR)$(INCPATH)
63+
install: $(LIBNAME) .install_common
6664
$(LIBTOOL) --mode=install install -m 644 $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
6765
install -m 644 $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
6866
sed -e 's,^prefix=.*,prefix=$(PREFIX),' -e 's,^Version:.*,Version: $(VERSION_PC),' -e 's,@CMAKE_INSTALL_LIBDIR@,lib,' \

makefile_include.mk

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,27 @@ HEADERS=tommath_private.h tommath_class.h tommath_superclass.h tommath_cutoffs.h
138138
#LIBPATH The directory for libtommath to be installed to.
139139
#INCPATH The directory to install the header files for libtommath.
140140
#DATAPATH The directory to install the pdf docs.
141+
#MANPATH The directory to install the manfile.
141142
DESTDIR ?=
142143
PREFIX ?= /usr/local
143144
LIBPATH ?= $(PREFIX)/lib
144145
INCPATH ?= $(PREFIX)/include
145146
DATAPATH ?= $(PREFIX)/share/doc/libtommath/pdf
147+
MANPATH ?= $(PREFIX)/share/man
148+
149+
.install_common:
150+
install -d $(DESTDIR)$(LIBPATH)
151+
install -d $(DESTDIR)$(INCPATH)
152+
153+
install_docs: manual
154+
install -d $(DESTDIR)$(DATAPATH)
155+
install -p -m 644 doc/bn.pdf $(DESTDIR)$(DATAPATH)
156+
install -d $(DESTDIR)$(MANPATH)
157+
install -p -m 644 doc/tommath.3 $(DESTDIR)$(MANPATH)/man3
158+
159+
160+
docs manual:
161+
$(MAKE) -C doc/ $@ V=$(V)
146162

147163
# build & run test-suite
148164
check: test

0 commit comments

Comments
 (0)