[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 06/33: Build src/utils: - Generate binaries - Generate man files
From: |
Bertrand Garrigues |
Subject: |
[groff] 06/33: Build src/utils: - Generate binaries - Generate man files |
Date: |
Sun, 07 Sep 2014 23:02:04 +0000 |
bgarrigues pushed a commit to branch automake2
in repository groff.
commit c589ee368b2a2a4bef4d9b45a3bf5b2a0f2f10d8
Author: Bertrand Garrigues <address@hidden>
Date: Mon Aug 18 23:17:58 2014 +0200
Build src/utils:
- Generate binaries
- Generate man files
---
Makefile.am | 49 ++++++++++++++++++++++
TESTS | 33 ++++++++++++++-
src/utils/addftinfo/Makefile.sub | 11 -----
src/utils/addftinfo/addftinfo.am | 7 +++
src/utils/afmtodit/{Makefile.sub => afmtodit.am} | 38 +++++++----------
src/utils/hpftodit/Makefile.sub | 8 ----
src/utils/hpftodit/hpftodit.am | 6 +++
src/utils/indxbib/Makefile.sub | 32 --------------
src/utils/indxbib/indxbib.am | 27 ++++++++++++
src/utils/lkbib/Makefile.sub | 6 ---
src/utils/lkbib/lkbib.am | 5 ++
src/utils/lookbib/Makefile.sub | 7 ---
src/utils/lookbib/lookbib.am | 4 ++
src/utils/pfbtops/Makefile.sub | 7 ---
src/utils/pfbtops/pfbtops.am | 7 +++
src/utils/tfmtodit/Makefile.sub | 6 ---
src/utils/tfmtodit/tfmtodit.am | 4 ++
src/utils/xtotroff/Makefile.sub | 8 ----
src/utils/xtotroff/xtotroff.am | 7 +++
19 files changed, 163 insertions(+), 109 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 17b6085..c2c0ccc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -522,6 +522,15 @@ include $(top_srcdir)/src/libs/libbib/libbib.am
include $(top_srcdir)/src/libs/libdriver/libdriver.am
include $(top_srcdir)/src/libs/libgroff/libgroff.am
include $(top_srcdir)/src/libs/libxutil/libxutil.am
+include $(top_srcdir)/src/utils/addftinfo/addftinfo.am
+include $(top_srcdir)/src/utils/afmtodit/afmtodit.am
+include $(top_srcdir)/src/utils/hpftodit/hpftodit.am
+include $(top_srcdir)/src/utils/indxbib/indxbib.am
+include $(top_srcdir)/src/utils/lkbib/lkbib.am
+include $(top_srcdir)/src/utils/lookbib/lookbib.am
+include $(top_srcdir)/src/utils/pfbtops/pfbtops.am
+include $(top_srcdir)/src/utils/tfmtodit/tfmtodit.am
+include $(top_srcdir)/src/utils/xtotroff/xtotroff.am
# Adding defs.h to BUILT_SOURCES will ensure that it will be built on
# make all or make check before all other targets. However, if another
@@ -560,3 +569,43 @@ EXTRA_DIST += \
PROBLEMS \
PROJECTS \
README.MinGW
+
+# Rule to build .man files. The brackets around the @ are used to prevent the
+# substitution of the variable by automake.
+.man.n:
+ @echo Making $@ from $<
+ rm -f $@
+ $(MKDIR_P) `dirname address@hidden
+ @LC_ALL=C \
+ sed -e "s|address@hidden@]|$(appresdir)|g" \
+ -e "s|address@hidden@]|$(bindir)|g" \
+ -e "s|address@hidden@]|$(BROKEN_SPOOLER_FLAGS)|g" \
+ -e "s|address@hidden@]|$(common_words_file)|g" \
+ -e "s|address@hidden@]|$(datasubdir)|g" \
+ -e "s|address@hidden@]|$(indexdir)/$(indexname)|g" \
+ -e "s|address@hidden@]|$(indexname)|g" \
+ -e "s|address@hidden@]|$(DEVICE)|g" \
+ -e "s|address@hidden@]|$(docdir)|g" \
+ -e "s|address@hidden@]|$(exampledir)|g" \
+ -e "s|address@hidden@]|$(fontdir)|g" \
+ -e "s|address@hidden@]|$(g)|g" \
+ -e "address@hidden@]!`echo $(g) | tr [a-z] [A-Z]`!g" \
+ -e "s|address@hidden@]|$(htmldocdir)|g" \
+ -e "s|address@hidden@]|$(indexext)|g" \
+ -e "s|address@hidden@]|$(legacyfontdir)|g" \
+ -e "s|address@hidden@]|$(localfontdir)|g" \
+ -e "s|address@hidden@]|$(localtmacdir)|g" \
+ -e "s|address@hidden@]|$(tmacdir)|g" \
+ -e "s|address@hidden@]|$(man1ext)|g" \
+ -e "s|address@hidden@]|$(man5ext)|g" \
+ -e "s|address@hidden@]|$(man7ext)|g" \
+ -e "s|address@hidden@]|`$(SHELL) $(top_srcdir)/mdate.sh $<`|g" \
+ -e "s|address@hidden@]|$(oldfontdir)|g" \
+ -e "s|address@hidden@]|$(pdfdocdir)|g" \
+ -e "s|address@hidden@]|$(systemtmacdir)|g" \
+ -e "s|address@hidden@]|$(tmac_an_prefix)|g" \
+ -e "s|address@hidden@]|$(tmac_m_prefix)|g" \
+ -e "s|address@hidden@]|$(tmacdir)/mm|g" \
+ -e "s|address@hidden@]|$(tmac_s_prefix)|g" \
+ -e "s|address@hidden@]|$(VERSION)|g" \
+ $< >$@
diff --git a/TESTS b/TESTS
index 61ab860..e06e875 100644
--- a/TESTS
+++ b/TESTS
@@ -56,6 +56,16 @@ Following files are generated:
- libgroff.a, version.cpp and extra files (charset.alias,
ref-add.sed, ref-del.sed)
- libxutils.a
+ - addftinfo
+ - afmtodit
+ - hpftodit
+ - indxbib
+ - lkbib
+ - lookbib
+ - pfbtops
+ - tfmtodit
+ - xtotroff
+ - man files (.n) in src/utils
In order to check and improve the dependencies, the following targets
were built from a clean environment:
@@ -64,6 +74,15 @@ were built from a clean environment:
- make libdriver.a
- make libgroff.a
- make libxutil.a
+ - make addftinfo
+ - make afmtodit
+ - make hpftodit
+ - make indxbib
+ - make lkbib
+ - make lookbib
+ - make pfbtops
+ - make tfmtodit
+ - make xtotroff
2.2 make clean
@@ -75,6 +94,8 @@ The following files remains (this is expected):
- src/include/stamp-h1
- .deps directories and .dirstamp files
+TODO: .n files, afmtodit
+
2.3 make mostlyclean
Like 'make clean', but the following files also remain (expected):
@@ -83,6 +104,8 @@ The following files remains (this is expected):
version.cpp.
- gnulib's charset.alias, ref-add.sed, ref-del.sed and configmake.h
+TODO: .n files, afmtodit
+
2.4 make distclean
Like 'make clean', but the following files are also cleaned:
@@ -119,10 +142,18 @@ The following files remains (this is expected):
- If file charset.alias is always present in
$(DESTDIR)/usr/local/lib, make install update it by adding 'groff'
to the list of programs using it. Otherwise nothing is installed.
+ - programs from src/utils are installed in $(DESTDIR)/usr/local/bin
+ - man files from src/utils are installed in
$(DESTDIR)/usr/local/share/man/man1
2.7 make uninstall
+
+ Removes:
+
+ - $(DESTDIR)/usr/local/lib/charset.alias if exists
+ - $(DESTDIR)/usr/local/bin/*
+ - $(DESTDIR)/usr/local/man/man1/*
- - Removes $(DESTDIR)/usr/local/lib/charset.alias if exists
+ TODO: indexbib specific rules
2.8 make dist
diff --git a/src/utils/addftinfo/Makefile.sub b/src/utils/addftinfo/Makefile.sub
deleted file mode 100644
index 096af0d..0000000
--- a/src/utils/addftinfo/Makefile.sub
+++ /dev/null
@@ -1,11 +0,0 @@
-PROG=addftinfo$(EXEEXT)
-MAN1=addftinfo.n
-XLIBS=$(LIBGROFF)
-OBJS=\
- addftinfo.$(OBJEXT) \
- guess.$(OBJEXT)
-CCSRCS=\
- $(srcdir)/addftinfo.cpp \
- $(srcdir)/guess.cpp
-HDRS=\
- $(srcdir)/guess.h
diff --git a/src/utils/addftinfo/addftinfo.am b/src/utils/addftinfo/addftinfo.am
new file mode 100644
index 0000000..a454ce6
--- /dev/null
+++ b/src/utils/addftinfo/addftinfo.am
@@ -0,0 +1,7 @@
+bin_PROGRAMS += addftinfo
+man1_MANS += src/utils/addftinfo/addftinfo.n
+addftinfo_LDADD = libgroff.a
+addftinfo_SOURCES = \
+ src/utils/addftinfo/addftinfo.cpp \
+ src/utils/addftinfo/guess.cpp \
+ src/utils/addftinfo/guess.h
diff --git a/src/utils/afmtodit/Makefile.sub b/src/utils/afmtodit/afmtodit.am
similarity index 50%
rename from src/utils/afmtodit/Makefile.sub
rename to src/utils/afmtodit/afmtodit.am
index ce0a3d8..ebb4801 100644
--- a/src/utils/afmtodit/Makefile.sub
+++ b/src/utils/afmtodit/afmtodit.am
@@ -1,7 +1,7 @@
# Copyright (C) 2013, 2014
# Free Software Foundation, Inc.
#
-# Last update: 30 Mar 2014
+# Last update: Aug 2014
#
# This file is part of groff.
#
@@ -18,32 +18,24 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-MAN1=afmtodit.n
-MOSTLYCLEANADD=afmtodit
+afmtodit_srcdir = $(top_srcdir)/src/utils/afmtodit
-all: afmtodit
+bin_SCRIPTS += afmtodit
+man1_MANS += src/utils/afmtodit/afmtodit.n
-afmtodit: afmtodit.pl afmtodit.tables
+afmtodit: $(afmtodit_srcdir)/afmtodit.pl $(afmtodit_srcdir)/afmtodit.tables
if test -n "$(PERL)"; then \
sed -e "s|/usr/bin/perl|$(PERL)|" \
- -e "s|@VERSION@|$(version)$(revision)|" \
- -e "s|@FONTDIR@|$(fontdir)|" \
- -e "/@afmtodit.tables@/ r $(srcdir)/afmtodit.tables" \
- -e "/@afmtodit.tables@/ d" \
- $(srcdir)/afmtodit.pl >afmtodit; \
+ -e "s|address@hidden@]|$(VERSION)|" \
+ -e "s|address@hidden@]|$(fontdir)|" \
+ -e "/address@hidden@]/ r $(afmtodit_srcdir)/afmtodit.tables" \
+ -e "/address@hidden@]/ d" \
+ $(afmtodit_srcdir)/afmtodit.pl >afmtodit; \
else \
- sed -e "s|@VERSION@|$(version)$(revision)|" \
- -e "s|@FONTDIR@|$(fontdir)|" \
- -e "/@afmtodit.tables@/ r $(srcdir)/afmtodit.tables" \
- -e "/@afmtodit.tables@/ d" \
- $(srcdir)/afmtodit.pl >afmtodit; \
+ sed -e "s|address@hidden@]|$(VERSION)|" \
+ -e "s|address@hidden@]|$(fontdir)|" \
+ -e "/address@hidden@]/ r $(afmtodit_srcdir)/afmtodit.tables" \
+ -e "/address@hidden@]/ d" \
+ $(afmtodit_srcdir)/afmtodit.pl >afmtodit; \
fi
chmod +x afmtodit
-
-install_data: afmtodit
- -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
- rm -f $(DESTDIR)$(bindir)/afmtodit
- $(INSTALL_SCRIPT) afmtodit $(DESTDIR)$(bindir)/afmtodit
-
-uninstall_sub:
- rm -f $(DESTDIR)$(bindir)/afmtodit
diff --git a/src/utils/hpftodit/Makefile.sub b/src/utils/hpftodit/Makefile.sub
deleted file mode 100644
index 6e80b47..0000000
--- a/src/utils/hpftodit/Makefile.sub
+++ /dev/null
@@ -1,8 +0,0 @@
-PROG=hpftodit$(EXEEXT)
-MAN1=hpftodit.n
-XLIBS=$(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=hpftodit.$(OBJEXT) \
- hpuni.$(OBJEXT)
-CCSRCS=$(srcdir)/hpftodit.cpp \
- $(srcdir)/hpuni.cpp
diff --git a/src/utils/hpftodit/hpftodit.am b/src/utils/hpftodit/hpftodit.am
new file mode 100644
index 0000000..0971b01
--- /dev/null
+++ b/src/utils/hpftodit/hpftodit.am
@@ -0,0 +1,6 @@
+bin_PROGRAMS += hpftodit
+man1_MANS += src/utils/hpftodit/hpftodit.n
+hpftodit_LDADD = libgroff.a $(LIBM)
+hpftodit_SOURCES = \
+ src/utils/hpftodit/hpftodit.cpp \
+ src/utils/hpftodit/hpuni.cpp
diff --git a/src/utils/indxbib/Makefile.sub b/src/utils/indxbib/Makefile.sub
deleted file mode 100644
index cd11e8c..0000000
--- a/src/utils/indxbib/Makefile.sub
+++ /dev/null
@@ -1,32 +0,0 @@
-PROG=indxbib$(EXEEXT)
-MAN1=indxbib.n
-XLIBS=$(LIBBIB) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=\
- indxbib.$(OBJEXT) \
- signal.$(OBJEXT)
-CCSRCS=\
- $(srcdir)/indxbib.cpp
-CSRCS=\
- $(srcdir)/signal.c
-NAMEPREFIX=$(g)
-
-install_data: $(srcdir)/eign
- -test -d $(DESTDIR)$(datadir) \
- || $(mkinstalldirs) $(DESTDIR)$(datadir)
- -test -d $(DESTDIR)$(dataprogramdir) \
- || $(mkinstalldirs) $(DESTDIR)$(dataprogramdir)
- -test -d $(DESTDIR)$(datasubdir) \
- || $(mkinstalldirs) $(DESTDIR)$(datasubdir)
- if test -f /usr/lib/eign; then \
- rm -f $(DESTDIR)$(common_words_file); \
- ln -s /usr/lib/eign $(DESTDIR)$(common_words_file) 2>/dev/null \
- || ln /usr/lib/eign $(DESTDIR)$(common_words_file) 2>/dev/null \
- || cp /usr/lib/eign $(DESTDIR)$(common_words_file); \
- else \
- rm -f $(DESTDIR)$(common_words_file); \
- $(INSTALL_DATA) $(srcdir)/eign $(DESTDIR)$(common_words_file); \
- fi
-
-uninstall_sub:
- rm -f $(DESTDIR)$(common_words_file)
diff --git a/src/utils/indxbib/indxbib.am b/src/utils/indxbib/indxbib.am
new file mode 100644
index 0000000..0efa1c2
--- /dev/null
+++ b/src/utils/indxbib/indxbib.am
@@ -0,0 +1,27 @@
+# Copyright (C) 2014
+# Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+indxbib_srcdir = $(top_srcdir)/src/utils/indxbib
+bin_PROGRAMS += indxbib
+indxbib_SOURCES = \
+ src/utils/indxbib/indxbib.cpp \
+ src/utils/indxbib/signal.c
+src/utils/indxbib/indxbib.$(OBJEXT): defs.h
+indxbib_LDADD = libbib.a libgroff.a $(LIBM)
+man1_MANS += src/utils/indxbib/indxbib.n
+
diff --git a/src/utils/lkbib/Makefile.sub b/src/utils/lkbib/Makefile.sub
deleted file mode 100644
index 4964ee0..0000000
--- a/src/utils/lkbib/Makefile.sub
+++ /dev/null
@@ -1,6 +0,0 @@
-PROG=lkbib$(EXEEXT)
-MAN1=lkbib.n
-XLIBS=$(LIBBIB) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=lkbib.$(OBJEXT)
-CCSRCS=$(srcdir)/lkbib.cpp
diff --git a/src/utils/lkbib/lkbib.am b/src/utils/lkbib/lkbib.am
new file mode 100644
index 0000000..82b4768
--- /dev/null
+++ b/src/utils/lkbib/lkbib.am
@@ -0,0 +1,5 @@
+bin_PROGRAMS += lkbib
+man1_MANS += src/utils/lkbib/lkbib.n
+lkbib_LDADD = libbib.a libgroff.a $(LIBM)
+lkbib_SOURCES = src/utils/lkbib/lkbib.cpp
+src/utils/lkbib/lkbib.$(OBJEXT): defs.h
diff --git a/src/utils/lookbib/Makefile.sub b/src/utils/lookbib/Makefile.sub
deleted file mode 100644
index 9ca2d88..0000000
--- a/src/utils/lookbib/Makefile.sub
+++ /dev/null
@@ -1,7 +0,0 @@
-PROG=lookbib$(EXEEXT)
-MAN1=lookbib.n
-XLIBS=$(LIBBIB) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=lookbib.$(OBJEXT)
-CCSRCS=$(srcdir)/lookbib.cpp
-NAMEPREFIX=$(g)
diff --git a/src/utils/lookbib/lookbib.am b/src/utils/lookbib/lookbib.am
new file mode 100644
index 0000000..e24d4ef
--- /dev/null
+++ b/src/utils/lookbib/lookbib.am
@@ -0,0 +1,4 @@
+bin_PROGRAMS += lookbib
+man1_MANS += src/utils/lookbib/lookbib.n
+lookbib_LDADD = libbib.a libgroff.a $(LIBM)
+lookbib_SOURCES = src/utils/lookbib/lookbib.cpp
diff --git a/src/utils/pfbtops/Makefile.sub b/src/utils/pfbtops/Makefile.sub
deleted file mode 100644
index 451b519..0000000
--- a/src/utils/pfbtops/Makefile.sub
+++ /dev/null
@@ -1,7 +0,0 @@
-PROG=pfbtops$(EXEEXT)
-MAN1=pfbtops.n
-OBJS=pfbtops.$(OBJEXT)
-CSRCS=$(srcdir)/pfbtops.c
-XLIBS=$(LIBGROFF)
-MLIB=$(LIBM)
-LINK.c=$(CCC) $(CCFLAGS) $(LDFLAGS)
diff --git a/src/utils/pfbtops/pfbtops.am b/src/utils/pfbtops/pfbtops.am
new file mode 100644
index 0000000..e59e74d
--- /dev/null
+++ b/src/utils/pfbtops/pfbtops.am
@@ -0,0 +1,7 @@
+bin_PROGRAMS += pfbtops
+man1_MANS += src/utils/pfbtops/pfbtops.n
+pfbtops_SOURCES = src/utils/pfbtops/pfbtops.c
+pfbtops_LDADD = libgroff.a $(LIBM)
+# We use the following trick to force the use of C++ compiler
+# See the Automake manual, "Libtool Convenience Libraries"
+nodist_EXTRA_pfbtops_SOURCES = src/utils/pfbtops/dummy.cpp
diff --git a/src/utils/tfmtodit/Makefile.sub b/src/utils/tfmtodit/Makefile.sub
deleted file mode 100644
index 1612104..0000000
--- a/src/utils/tfmtodit/Makefile.sub
+++ /dev/null
@@ -1,6 +0,0 @@
-PROG=tfmtodit$(EXEEXT)
-MAN1=tfmtodit.n
-XLIBS=$(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=tfmtodit.$(OBJEXT)
-CCSRCS=$(srcdir)/tfmtodit.cpp
diff --git a/src/utils/tfmtodit/tfmtodit.am b/src/utils/tfmtodit/tfmtodit.am
new file mode 100644
index 0000000..403b699
--- /dev/null
+++ b/src/utils/tfmtodit/tfmtodit.am
@@ -0,0 +1,4 @@
+bin_PROGRAMS += tfmtodit
+man1_MANS += src/utils/tfmtodit/tfmtodit.n
+tfmtodit_SOURCES = src/utils/tfmtodit/tfmtodit.cpp
+tfmtodit_LDADD = libgroff.a $(LIBM)
diff --git a/src/utils/xtotroff/Makefile.sub b/src/utils/xtotroff/Makefile.sub
deleted file mode 100644
index fc0d76a..0000000
--- a/src/utils/xtotroff/Makefile.sub
+++ /dev/null
@@ -1,8 +0,0 @@
-PROG=xtotroff$(EXEEXT)
-MAN1=xtotroff.n
-MLIB=$(LIBM)
-XLIBS=$(LIBXUTIL) $(LIBGROFF)
-EXTRA_CFLAGS=$(X_CFLAGS)
-EXTRA_LDFLAGS=$(X_LIBS) $(X_PRE_LIBS) -lXaw -lXt -lX11 $(X_EXTRA_LIBS)
-OBJS=xtotroff.$(OBJEXT)
-CSRCS=$(srcdir)/xtotroff.c
diff --git a/src/utils/xtotroff/xtotroff.am b/src/utils/xtotroff/xtotroff.am
new file mode 100644
index 0000000..d439a09
--- /dev/null
+++ b/src/utils/xtotroff/xtotroff.am
@@ -0,0 +1,7 @@
+bin_PROGRAMS += xtotroff
+man1_MANS += src/utils/xtotroff/xtotroff.n
+xtotroff_SOURCES = src/utils/xtotroff/xtotroff.c
+XLIBS=$(LIBXUTIL) $(LIBGROFF)
+xtotroff_LDADD = libxutil.a libgroff.a $(X_LIBS) $(X_PRE_LIBS) \
+ -lXaw -lXt -lX11 $(X_EXTRA_LIBS) $(LIBM)
+xtotroff_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 06/33: Build src/utils: - Generate binaries - Generate man files,
Bertrand Garrigues <=