groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 21/33: - tmac: Fix mostlyclean target. In the previous commit, t


From: Bertrand Garrigues
Subject: [groff] 21/33: - tmac: Fix mostlyclean target. In the previous commit, the in-source build was not properly tested, and some files of the source tree were mistakenly deleted
Date: Sun, 07 Sep 2014 23:02:12 +0000

bgarrigues pushed a commit to branch automake2
in repository groff.

commit 77307592c957a3551cf4a20f626c60ff841a7f5e
Author: Bertrand Garrigues <address@hidden>
Date:   Sat Sep 6 13:30:32 2014 +0200

    - tmac:  Fix mostlyclean target. In the previous commit, the in-source 
build was not properly tested, and some files of the source tree were 
mistakenly deleted
    
    - contrib/chem: build and installation
---
 Makefile.am               |   13 ++++-
 TESTS                     |   63 ++++++++++++++++--------
 contrib/chem/Makefile.sub |  103 ---------------------------------------
 contrib/chem/chem.am      |  117 +++++++++++++++++++++++++++++++++++++++++++++
 tmac/.gitignore           |    8 +++
 tmac/tmac.am              |    2 +-
 6 files changed, 180 insertions(+), 126 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c25dcb3..05c3e13 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -163,7 +163,9 @@ datasubdir=$(dataprogramdir)/$(VERSION)
 # `infodir' says where to install info files.
 
 # docdir
-# `docdir' says where to install documentation files.
+# `docdir' says where to install documentation files.  The default
+# location is ${datarootdir}/doc/${PACKAGE}, but we add the version
+docdir=$(datarootdir)/doc/${PACKAGE}-$(VERSION)
 
 # `exampledir' says where to install example files.
 exampledir=$(docdir)/examples
@@ -521,6 +523,7 @@ AM_YFLAGS = -d -v
 
 include $(top_srcdir)/lib/gnulib.mk
 include $(top_srcdir)/arch/misc/misc.am
+include $(top_srcdir)/contrib/chem/chem.am
 include $(top_srcdir)/font/devX100/devX100.am
 include $(top_srcdir)/font/devX100-12/devX100-12.am
 include $(top_srcdir)/font/devX75/devX75.am
@@ -589,7 +592,7 @@ lib/localcharset.$(OBJEXT): lib/configmake.h
 
 # directories specific to groff
 uninstall-hook: uninstall_groffdirs
-uninstall_groffdirs: uninstall_devpdf
+uninstall_groffdirs: uninstall_devpdf uninstall_tmac_hook
        if test -d $(DESTDIR)$(datasubdir); then \
          rm -rf $(DESTDIR)$(fontdir); \
          rm -rf $(DESTDIR)$(oldfontdir); \
@@ -604,6 +607,12 @@ uninstall_groffdirs: uninstall_devpdf
        if test -d $(DESTDIR)$(libprogramdir); then \
          rmdir $(DESTDIR)$(libprogramdir); \
        fi
+       if test -d $(DESTDIR)$(docdir); then \
+         if test -d $(DESTDIR)$(exampledir); then \
+           rmdir $(DESTDIR)$(exampledir); \
+         fi; \
+         rmdir $(DESTDIR)$(docdir); \
+       fi
 
 # Other files that should be present in the distribution tarball.
 EXTRA_DIST += \
diff --git a/TESTS b/TESTS
index 97ce1c0..fddcdaf 100644
--- a/TESTS
+++ b/TESTS
@@ -20,6 +20,7 @@ Current status
   - Build font/*
   - man files from 'man' directory installed
   - tmac files from 'tmac' directory installed
+  - Build and installation of contrib/chem
 
 Tests
 -----
@@ -133,6 +134,9 @@ from font: font files in
   - devps
   - devutf8
 
+from contrib/chem:
+  - `chem' script and 3 README files
+
 In order to check and improve the dependencies, the following targets
 were built from a clean environment:
   - make lib/libgnu.a
@@ -170,6 +174,7 @@ were built from a clean environment:
   - make grog
   - make nroff
   - make troff
+  - make chem
 
 2.2 make clean
 
@@ -181,10 +186,6 @@ The following files remain (this is expected):
   - src/include/stamp-h1
   - .deps directories and .dirstamp files
 
-  - .n files, afmtodit are cleaned
-  - shdeps.sed is cleaned
-  - binaries from bin_PROGRAMS are cleaned
-
 2.3 make mostlyclean
 
   Like 'make clean', but the following files also remain (expected):
@@ -260,7 +261,19 @@ Differences with former build system:
     stripped (comments removed) at build time. Checked that they are
     strictly identical to the one install by the original build
     system.
+  
+  - contrib/chem:
 
+    -- chem.pic installed in
+    $(DESTDIR)/usr/local/share/groff/1.22.2/pic/chem.pic
+
+    -- other chem files installed in
+    $(DESTDIR)/usr/local/share/doc/groff-1.22.2/examples, identical to
+    the old build system.
+    
+    -- contrib/chem/README is strangely build but not installed, this
+       is the behaviour on the old build system.
+    
 Diff with previous build system:
   - devcp1047 fonts are installed $(DESTDIR)/usr/local/groff/1.22.2/font
 
@@ -272,23 +285,34 @@ TODO:
   value in tmac/Makefile.sub, I don't quite understand how these
   variables could be set.
 
+  - Add automake conditional for examples, html, and doc in `contrib'.
+
 2.7 make uninstall
 
-  Removes:
-
-  - $(DESTDIR)/usr/local/lib/charset.alias if exists
-  - $(DESTDIR)/usr/local/bin/*
-  - $(DESTDIR)/usr/local/man/man1/*
-  - $(DESTDIR)/usr/local/man/man5/*
-  - $(DESTDIR)/usr/local/share/groff/1.22/eign
-  - $(DESTDIR)/usr/local/share/groff/1.22/
-  - $(DESTDIR)/usr/local/share/groff/1.22/font
-  - $(DESTDIR)/usr/local/share/groff/1.22/oldfont
-  - $(DESTDIR)/usr/local/share/groff/1.22/tmac
-  - $(DESTDIR)/usr/local/share/groff/
-  - $(DESTDIR)/usr/X11/lib/X11/app-defaults/GXditview and
-    GXditview-color. However, GXditview.old and GXditview-color.old
-    are not removed (this is the behaviour on the old build system)
+  - Tree after uninstall:
+.
+└── usr
+    ├── local
+    │   ├── bin
+    │   ├── lib
+    │   └── share
+    │       ├── doc
+    │       └── man
+    │           ├── man1
+    │           ├── man5
+    │           └── man7
+    └── X11
+        └── lib
+            └── X11
+                └── app-defaults
+
+  - Notes:
+    -- $(DESTDIR)/usr/local/lib/charset.alias is removed if exists
+    -- $(DESTDIR)/usr/X11/lib/X11/app-defaults/GXditview and
+    GXditview-color are removed. However, GXditview.old and
+    GXditview-color.old are not removed (this is the behaviour on the
+    old build system)
+  
   
 2.8 make dist
 
@@ -362,4 +386,3 @@ Notes
   - Gnulib: some files of src/libs/libgroff could be replaced by their
     gnulib equivalent
   - Gnulib: git-version-gen could be used
-
diff --git a/contrib/chem/Makefile.sub b/contrib/chem/Makefile.sub
deleted file mode 100644
index 9f67cd0..0000000
--- a/contrib/chem/Makefile.sub
+++ /dev/null
@@ -1,103 +0,0 @@
-# Makefile.sub for `chem' (integration into the `groff' source tree)
-
-# File position: <groff-source>/contrib/chem/Makefile.sub
-
-# Copyright (C) 2006, 2009, 2010, 2013-14
-#   Free Software Foundation, Inc.
-# Written by Bernd Warken <address@hidden>.
-
-# Last update: 30 Mar 2014
-
-# This file is part of `chem' which 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 (GPL) version 2 as
-# published by the Free Software Foundation.
-
-# `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.
-
-# The GPL2 license text is available in the internet at
-# <http://www.gnu.org/licenses/gpl-2.0.html>.
-
-########################################################################
-
-MAN1=chem.n
-MOSTLYCLEANADD=\
-  chem \
-  chem.n \
-  README \
-  examples/README \
-  examples/122/README
-
-all: README chem $(MAN1) $(make_examples)
-
-README: $(srcdir)/README.txt
-       sed -e "s|@g@|$(g)|g" $? >$@
-
-.PHONY: examples
-examples: examples/README examples/122/README
-
-examples/README: $(srcdir)/examples/README.txt
-       -test -d examples || $(mkinstalldirs) examples
-       sed -e "s|@g@|$(g)|g" $? >$@
-
-examples/122/README: $(srcdir)/examples/122/README.txt
-       -test -d examples || $(mkinstalldirs) examples
-       -test -d examples/122 || $(mkinstalldirs) examples/122
-       sed -e "s|@g@|$(g)|g" $? >$@
-
-chem: $(srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
-       rm -f $@
-       sed -f "$(SH_DEPS_SED_SCRIPT)" \
-           -e "s|@g@|$(g)|g" \
-           -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
-           -e "s|@MACRODIR@|$(DESTDIR)$(tmacdir)|g" \
-           -e "s|@PICDIR@|$(DESTDIR)$(datasubdir)/pic|g" \
-           -e "s|@VERSION@|$(version)$(revision)|g" \
-           -e "$(SH_SCRIPT_SED_CMD)" \
-           $(srcdir)/chem.pl >$@
-       chmod +x $@
-
-install_data: install_always $(make_install_examples)
-install_always: chem README $(srcdir)/chem.pic
-       -test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
-       rm -f $(DESTDIR)$(bindir)/$(g)chem
-       $(INSTALL_SCRIPT) chem $(DESTDIR)$(bindir)/$(g)chem
-       -test -d $(DESTDIR)$(datasubdir)/pic \
-          || $(mkinstalldirs) $(DESTDIR)$(datasubdir)/pic
-       rm -f $(DESTDIR)$(datasubdir)/pic/chem.pic
-       $(INSTALL_DATA) $(srcdir)/chem.pic \
-         $(DESTDIR)$(datasubdir)/pic/chem.pic
-
-install_examples: install_always examples
-       -test -d $(DESTDIR)$(exampledir)/chem \
-          || $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem
-       -test -d $(DESTDIR)$(exampledir)/chem/122 \
-          || $(mkinstalldirs) $(DESTDIR)$(exampledir)/chem/122
-       -find $(DESTDIR)$(exampledir)/chem -type f -exec rm -f '{}' ';'
-       $(INSTALL_DATA) examples/README $(DESTDIR)$(exampledir)/chem/README
-       for i in $(srcdir)/examples/*.chem; do \
-         n=`echo $$i | sed 's|$(srcdir)/examples/||g'`; \
-         $(INSTALL_DATA) $$i $(DESTDIR)$(exampledir)/chem/$$n; \
-       done
-       $(INSTALL_DATA) examples/122/README \
-         $(DESTDIR)$(exampledir)/chem/122/README
-       for i in $(srcdir)/examples/122/*.chem; do \
-         n=`echo $$i | sed 's|$(srcdir)/examples/122/||g'`; \
-         $(INSTALL_DATA) $$i $(DESTDIR)$(exampledir)/chem/122/$$n; \
-       done
-
-uninstall_sub: uninstall_always $(make_uninstall_examples)
-uninstall_always:
-       rm -f $(DESTDIR)$(bindir)/chem
-       rm -f $(DESTDIR)$(datasubdir)/pic/chem.pic
-       -rmdir $(DESTDIR)$(datasubdir)/pic
-
-uninstall_examples: uninstall_always
-       rm -f $(DESTDIR)$(exampledir)/chem/122/*
-       -rmdir $(DESTDIR)$(exampledir)/chem/122
-       rm -f $(DESTDIR)$(exampledir)/chem/*
-       -rmdir $(DESTDIR)$(exampledir)/chem
diff --git a/contrib/chem/chem.am b/contrib/chem/chem.am
new file mode 100644
index 0000000..953025b
--- /dev/null
+++ b/contrib/chem/chem.am
@@ -0,0 +1,117 @@
+# Automake rules for `chem' (integration into the `groff' source tree)
+
+# File position: <groff-source>/contrib/chem/chem.am
+
+# Copyright (C) 2006, 2009, 2010, 2013-14
+#   Free Software Foundation, Inc.
+# Written by Bernd Warken <address@hidden>.
+# Moved to automake by Bertrand Garrigues
+
+# This file is part of `chem' which 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 (GPL) version 2 as
+# published by the Free Software Foundation.
+
+# `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.
+
+# The GPL2 license text is available in the internet at
+# <http://www.gnu.org/licenses/gpl-2.0.html>.
+
+########################################################################
+
+chem_srcdir = $(top_srcdir)/contrib/chem
+bin_SCRIPTS += chem
+
+# Files installed in $(datasubdir)/pic
+chempicdir = $(datasubdir)/pic
+dist_chempic_DATA = contrib/chem/chem.pic
+
+
+CHEM_GENEXAMPLES = contrib/chem/examples/README
+CHEM_EXAMPLES =  \
+  contrib/chem/examples/atp.chem \
+  contrib/chem/examples/cholesterin.chem \
+  contrib/chem/examples/ethamivan.chem \
+  contrib/chem/examples/lsd.chem \
+  contrib/chem/examples/morphine.chem \
+  contrib/chem/examples/penicillin.chem \
+  contrib/chem/examples/reserpine.chem
+
+# Files installed in $(exampledir)/chem
+chemexampledir = $(exampledir)/chem
+nodist_chemexample_DATA = $(CHEM_GENEXAMPLES)
+dist_chemexample_DATA = $(CHEM_EXAMPLES)
+
+# Files installed in $(exampledir)/chem/122. All the .chem files in 122 are 
+# lazily installed by the local install target
+chemexample122dir = $(chemexampledir)/122
+nodist_chemexample122_DATA = contrib/chem/examples/122/README
+
+EXTRA_DIST += \
+  contrib/chem/ChangeLog \
+  contrib/chem/chem.man \
+  contrib/chem/chem.pic \
+  contrib/chem/chem.pl \
+  contrib/chem/README.txt \
+  contrib/chem/examples/README.txt \
+  contrib/chem/examples/122/README.txt
+
+man1_MANS += contrib/chem/chem.n
+MOSTLYCLEANFILES += $(CHEM_GENEXAMPLES) $(nodist_chemexample122_DATA) \
+  chem \
+  contrib/chem/README
+
+# This is strangly built but not installed
+all: contrib/chem/README
+
+contrib/chem/README: $(chem_srcdir)/README.txt
+       @$(MKDIR_P) contrib/chem/
+       sed -e "s|address@hidden@]|$(g)|g" $? >$@
+
+contrib/chem/examples/README: $(chem_srcdir)/examples/README.txt
+       @$(MKDIR_P) contrib/chem/examples
+       sed -e "s|address@hidden@]|$(g)|g" $? >$@
+
+contrib/chem/examples/122/README: $(chem_srcdir)/examples/122/README.txt
+       @$(MKDIR_P) contrib/chem/examples/122
+       sed -e "s|address@hidden@]|$(g)|g" $? >$@
+
+chem: $(chem_srcdir)/chem.pl $(SH_DEPS_SED_SCRIPT)
+       rm -f $@
+       sed -f "$(SH_DEPS_SED_SCRIPT)" \
+           -e "s|address@hidden@]|$(g)|g" \
+           -e "s|address@hidden@]|$(DESTDIR)$(bindir)|g" \
+           -e "s|address@hidden@]|$(DESTDIR)$(tmacdir)|g" \
+           -e "s|address@hidden@]|$(DESTDIR)$(datasubdir)/pic|g" \
+           -e "s|address@hidden@]|$(VERSION)|g" \
+           -e "$(SH_SCRIPT_SED_CMD)" \
+           $(chem_srcdir)/chem.pl >$@
+       chmod +x $@
+
+install-data-local: install_chem_extra
+install_chem_extra:
+       -test -d $(DESTDIR)$(chemexample122dir) \
+          || $(mkinstalldirs) $(DESTDIR)$(chemexample122dir);
+       for i in $(chem_srcdir)/examples/122/*.chem; do \
+         n=`echo $$i | sed 's|$(chem_srcdir)/examples/122/||g'`; \
+         $(INSTALL_DATA) $$i $(DESTDIR)$(chemexample122dir)/$$n; \
+       done
+
+uninstall-local: uninstall_chem_extra
+uninstall_chem_extra:
+       rm -f $(DESTDIR)$(exampledir)/chem/122/*
+       -rmdir $(DESTDIR)$(exampledir)/chem/122
+       rm -f $(DESTDIR)$(exampledir)/chem/*
+       -rmdir $(DESTDIR)$(exampledir)/chem
+       -rmdir $(DESTDIR)$(datasubdir)/pic
+
+dist-hook: dist_chem
+dist_chem:
+       chmod u+w $(distdir)/contrib/chem/examples/122
+       for i in $(chem_srcdir)/examples/122/*.chem; do \
+         cp -f $$i $(distdir)/contrib/chem/examples/122; \
+       done
diff --git a/tmac/.gitignore b/tmac/.gitignore
index b760cd5..45d432b 100644
--- a/tmac/.gitignore
+++ b/tmac/.gitignore
@@ -8,3 +8,11 @@ groff_ms.n
 groff_www.n
 groff_trace.n
 stamp-strip
+doc-common
+doc-ditroff
+doc-nroff
+doc-old.tmac
+doc-syms
+doc.tmac
+e.tmac
+www.tmac
diff --git a/tmac/tmac.am b/tmac/tmac.am
index 34660f5..e8a6870 100644
--- a/tmac/tmac.am
+++ b/tmac/tmac.am
@@ -113,7 +113,7 @@ nodist_mdoc_DATA = $(TMACMDOCFILES)
 # Installed in localtmacdir
 dist_localtmac_DATA = tmac/man.local tmac/mdoc.local
 
-MOSTLYCLEANFILES += $(TMACMDOCFILES) $(TMACSPECIALFILES) $(TMACSTRIPFILES) \
+MOSTLYCLEANFILES += $(TMACMDOCFILES) tmac/www.tmac $(TMACSTRIPFILES) \
    tmac/stamp-wrap \
    tmac/*-wrap
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]