groff-commit
[Top][All Lists]
Advanced

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

[groff] 03/46: Build the 4 static libraries in src/libs.


From: Bertrand Garrigues
Subject: [groff] 03/46: Build the 4 static libraries in src/libs.
Date: Tue, 27 Jan 2015 22:59:17 +0000

bgarrigues pushed a commit to branch automake3
in repository groff.

commit a23c589e4e0fbc9a22042b6771e990b2f9cc3278
Author: Bertrand Garrigues <address@hidden>
Date:   Sun Aug 17 11:30:10 2014 +0200

    Build the 4 static libraries in src/libs.
    
    They are `convenience libraries', (static libraries that are not
    installed), therefore added to the `noinst_LIBRARIES' variable.
    
    Non-recursive Makefile architecture: we don't use `SUBDIRS', but include
    .am files from the top-level Makefile.am.  Consequently, the source
    files list of each library is a list of paths relative to the top
    source directory.
    
    * src/libs: in each subdirectory, add a .am file with automake rules
      to build a .a.
    * Makefile.am: include .am from `src/libs'.
    * src/include/include.am: defs.h is a generated header, not
      distributed, not installed.
---
 Makefile.am                                        |   24 ++-
 TESTS                                              |   52 +++++-
 src/include/Makefile.sub                           |   82 -------
 .../libbib/Makefile.sub => include/include.am}     |   41 ++---
 .../{libdriver/Makefile.sub => libbib/libbib.am}   |   29 +--
 src/libs/libdriver/{Makefile.sub => libdriver.am}  |   25 +--
 src/libs/libgroff/Makefile.sub                     |  223 --------------------
 src/libs/libgroff/libgroff.am                      |  115 ++++++++++
 src/libs/libxutil/{Makefile.sub => libxutil.am}    |   31 +--
 9 files changed, 227 insertions(+), 395 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1bb2a8e..37bd44e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -487,9 +487,12 @@ PURIFYCCFLAGS=
 # Add groff and gnulib m4 macros
 ACLOCAL_AMFLAGS = -I m4 -I gnulib_m4
 
-# Common preprocessor flags: gnulib includes
+# Common preprocessor flags: gnulib includes, common includes in
+# src/include, and config.h that is generated in the build tree
 AM_CPPFLAGS = \
+  -I$(top_srcdir)/src/include \
   -I$(top_srcdir)/lib \
+  -I$(top_builddir)/src/include \
   -I$(top_builddir)/lib
 
 # The following Automake variables will be overloaded by the various
@@ -517,6 +520,25 @@ man7_MANS =
 # source directory.
 
 include $(top_srcdir)/lib/gnulib.mk
+include $(top_srcdir)/src/include/include.am
+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
+
+# 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
+# target is built from a clean build tree, (for example make groff)
+# the files in BUILT_SOURCES will not be built first. That is why
+# additional dependencies where added in the .am files that lists
+# objects that use defs (for exmaple in groff.am:
+# src/roff/groff/groff.$(OBJEXT): defs.h)
+BUILT_SOURCES += defs.h
+
+# Same thing for gnulib's localcharset.c and configmake.h: gnulib uses
+# BUILT_SOURCES only, adding the following makes 'make lib/libgnu.a'
+# possible
+lib/localcharset.$(OBJEXT): lib/configmake.h
 
 # Other files that should be present in the distribution tarball.
 EXTRA_DIST += \
diff --git a/TESTS b/TESTS
index b587b40..3ea0895 100644
--- a/TESTS
+++ b/TESTS
@@ -12,6 +12,7 @@ Current status
 --------------
   - Gnulib integrated
   - Minimum Automake support
+  - Build src/libs/*
 
 Tests
 -----
@@ -46,16 +47,56 @@ Tests done in 2 configurations:
 
 2.1 make
 
-  - src/include/config.h generated
-  - lib/libgnu.a generated
+Following files are generated:
+
+  - src/include/config.h
+  - lib/libgnu.a
+  - libbib.a
+  - libdriver.a
+  - libgroff.a, version.cpp and extra files (charset.alias,
+    ref-add.sed, ref-del.sed)
+  - libxutils.a
+
+In order to check and improve the dependencies, the following targets
+were built from a clean environment:
+  - make lib/libgnu.a
+  - make libbib.a
+  - make libdriver.a
+  - make libgroff.a
+  - make libxutil.a
 
 2.2 make clean
 
 The following files remains (this is expected):
   - src/include/config.h
   - src/include/stamp-h1
+  - .deps directories and .dirstamp files
+
+TODO: following files should be cleaned:
+  - libgroff extra files and version.cpp
+
+2.3 make mostlyclean
+
+  Like 'make clean', but:
+  - lib*.a remain
+
+2.4 make dist-clean
+
+  To be checked
+
+2.5 make maintainer-clean
+
+  To be checked
+
+2.6 make install
+
+  To be checked
+
+2.7 make uninstall
+
+  To be checked
 
-2.3 make dist
+2.8 make dist
 
   groff-1.22.3.tar.gz is generated
 
@@ -74,7 +115,7 @@ The following files remains (this is expected):
     doc/
     font/
     man/
-    src/* (except include)
+    src/* (except include): src/libs .c .cpp are missing
     tmac
     test-groff.in
 
@@ -89,6 +130,9 @@ The following files remains (this is expected):
     aclocal.m4
     configure   
 
+2.9 make distcheck
+  
+  - fails (src/libs sources are missing)
 Notes
 -----
 
diff --git a/src/include/Makefile.sub b/src/include/Makefile.sub
deleted file mode 100644
index f282e86..0000000
--- a/src/include/Makefile.sub
+++ /dev/null
@@ -1,82 +0,0 @@
-# Makefile.sub for `include'
-#
-# File position: <groff-source>/src/include/Makefile.sub
-#
-# Copyright (C) 2014  Free Software Foundation, Inc.
-#
-# This file is part of `font utf8' 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 as published by
-# the Free Software Foundation, either version 2 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/gpl-2.0.html>.
-#
-########################################################################
-
-HDRS=\
-  assert.h \
-  cmap.h \
-  cset.h \
-  color.h \
-  device.h \
-  driver.h \
-  DviChar.h \
-  errarg.h \
-  error.h \
-  font.h \
-  geometry.h \
-  getopt.h \
-  getopt_int.h \
-  gettext.h \
-  htmlhint.h \
-  index.h \
-  lib.h \
-  macropath.h \
-  nonposix.h \
-  posix.h \
-  printer.h \
-  ptable.h \
-  refid.h \
-  relocate.h \
-  search.h \
-  searchpath.h \
-  stringclass.h \
-  symbol.h \
-  unicode.h \
-  XFontName.h
-GENHDRS=defs.h
-
-all depend: $(GENHDRS)
-
-defs.h: FORCE
-       @$(SHELL) $(top_srcdir)/gendef.sh defs.h \
-       "PROG_PREFIX=\"$(g)\"" \
-       "DEVICE=\"$(DEVICE)\"" \
-       "INSTALLPATH=\"$(prefix)\"" \
-       "BINPATH=\"$(bindir)\"" \
-       "FONTPATH=\"$(fontpath)\"" \
-       "MACROPATH=\"$(tmacpath)\"" \
-       "INDEX_SUFFIX=\"$(indexext)\"" \
-       "COMMON_WORDS_FILE=\"$(common_words_file)\"" \
-       "DEFAULT_INDEX_DIR=\"$(indexdir)\"" \
-       "DEFAULT_INDEX_NAME=\"$(indexname)\"" \
-       "DEFAULT_INDEX=\"$(indexdir)/$(indexname)\""
-
-FORCE:
-
-########################################################################
-# Emacs settings
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
diff --git a/src/libs/libbib/Makefile.sub b/src/include/include.am
similarity index 56%
rename from src/libs/libbib/Makefile.sub
rename to src/include/include.am
index e8986ab..8241fc7 100644
--- a/src/libs/libbib/Makefile.sub
+++ b/src/include/include.am
@@ -1,11 +1,9 @@
-# Makefile.sub for `libbib'
+# Automake rules for `include'
 #
-# File position: <groff-source>/src/libs/libbib/Makefile.sub
+# File position: <groff-source>/src/include/include.am
 #
 # Copyright (C) 2014  Free Software Foundation, Inc.
 #
-# This file is part of `font utf8' 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 as published by
 # the Free Software Foundation, either version 2 of the License, or
@@ -22,25 +20,18 @@
 #
 ########################################################################
 
-LIB=bib
-OBJS=\
-  common.$(OBJEXT) \
-  index.$(OBJEXT) \
-  linear.$(OBJEXT) \
-  search.$(OBJEXT) \
-  map.$(OBJEXT)
-CCSRCS=\
-  $(srcdir)/common.cpp \
-  $(srcdir)/index.cpp \
-  $(srcdir)/linear.cpp \
-  $(srcdir)/search.cpp
-CSRCS=\
-  $(srcdir)/map.c
+nodist_noinst_HEADERS = defs.h
+defs.h:
+       @$(SHELL) $(top_srcdir)/gendef.sh defs.h \
+       "PROG_PREFIX=\"$(g)\"" \
+       "DEVICE=\"$(DEVICE)\"" \
+       "INSTALLPATH=\"$(prefix)\"" \
+       "BINPATH=\"$(bindir)\"" \
+       "FONTPATH=\"$(fontpath)\"" \
+       "MACROPATH=\"$(tmacpath)\"" \
+       "INDEX_SUFFIX=\"$(indexext)\"" \
+       "COMMON_WORDS_FILE=\"$(common_words_file)\"" \
+       "DEFAULT_INDEX_DIR=\"$(indexdir)\"" \
+       "DEFAULT_INDEX_NAME=\"$(indexname)\"" \
+       "DEFAULT_INDEX=\"$(indexdir)/$(indexname)\""
 
-########################################################################
-# Emacs settings
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
diff --git a/src/libs/libdriver/Makefile.sub b/src/libs/libbib/libbib.am
similarity index 61%
copy from src/libs/libdriver/Makefile.sub
copy to src/libs/libbib/libbib.am
index 4659ffe..ca44191 100644
--- a/src/libs/libdriver/Makefile.sub
+++ b/src/libs/libbib/libbib.am
@@ -1,11 +1,9 @@
-# Makefile.sub for `libdriver'
+# Automake rules for `libbib'
 #
-# File position: <groff-source>/src/libs/libdriver/Makefile.sub
+# File position: <groff-source>/src/libs/libbib/libbib.am
 #
 # Copyright (C) 2014  Free Software Foundation, Inc.
 #
-# This file is part of `font utf8' 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 as published by
 # the Free Software Foundation, either version 2 of the License, or
@@ -22,18 +20,11 @@
 #
 ########################################################################
 
-LIB=driver
-OBJS=\
-  input.$(OBJEXT) \
-  printer.$(OBJEXT)
-CCSRCS=\
-  $(srcdir)/input.cpp \
-  $(srcdir)/printer.cpp
-
-########################################################################
-# Emacs settings
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
+noinst_LIBRARIES += libbib.a
+libbib_a_SOURCES = \
+  src/libs/libbib/common.cpp \
+  src/libs/libbib/index.cpp \
+  src/libs/libbib/linear.cpp \
+  src/libs/libbib/search.cpp \
+  src/libs/libbib/map.c
+src/libs/libbib/index.$(OBJEXT): defs.h
diff --git a/src/libs/libdriver/Makefile.sub b/src/libs/libdriver/libdriver.am
similarity index 61%
rename from src/libs/libdriver/Makefile.sub
rename to src/libs/libdriver/libdriver.am
index 4659ffe..6c504d2 100644
--- a/src/libs/libdriver/Makefile.sub
+++ b/src/libs/libdriver/libdriver.am
@@ -1,11 +1,9 @@
-# Makefile.sub for `libdriver'
+# Automake rules for `libdriver'
 #
-# File position: <groff-source>/src/libs/libdriver/Makefile.sub
+# File position: <groff-source>/src/libs/libdriver/libdriver.am
 #
 # Copyright (C) 2014  Free Software Foundation, Inc.
 #
-# This file is part of `font utf8' 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 as published by
 # the Free Software Foundation, either version 2 of the License, or
@@ -22,18 +20,7 @@
 #
 ########################################################################
 
-LIB=driver
-OBJS=\
-  input.$(OBJEXT) \
-  printer.$(OBJEXT)
-CCSRCS=\
-  $(srcdir)/input.cpp \
-  $(srcdir)/printer.cpp
-
-########################################################################
-# Emacs settings
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
+noinst_LIBRARIES += libdriver.a
+libdriver_a_SOURCES = \
+  src/libs/libdriver/input.cpp \
+  src/libs/libdriver/printer.cpp
diff --git a/src/libs/libgroff/Makefile.sub b/src/libs/libgroff/Makefile.sub
deleted file mode 100644
index 840d993..0000000
--- a/src/libs/libgroff/Makefile.sub
+++ /dev/null
@@ -1,223 +0,0 @@
-# Makefile.sub for `libgroff'
-#
-# File position: <groff-source>/src/libs/libgroff/Makefile.sub
-#
-# Copyright (C) 2014  Free Software Foundation, Inc.
-#
-# This file is part of `font utf8' 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 as published by
-# the Free Software Foundation, either version 2 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/gpl-2.0.html>.
-#
-########################################################################
-
-LIB=groff
-EXTRA_CFLAGS=-D__GETOPT_PREFIX=groff_ \
-             -DENABLE_RELOCATABLE=1 \
-             -DLIBDIR=\"$(libdir)\"
-OBJS=\
-  assert.$(OBJEXT) \
-  change_lf.$(OBJEXT) \
-  cmap.$(OBJEXT) \
-  color.$(OBJEXT) \
-  cset.$(OBJEXT) \
-  device.$(OBJEXT) \
-  errarg.$(OBJEXT) \
-  error.$(OBJEXT) \
-  fatal.$(OBJEXT) \
-  filename.$(OBJEXT) \
-  font.$(OBJEXT) \
-  fontfile.$(OBJEXT) \
-  geometry.$(OBJEXT) \
-  getopt.$(OBJEXT) \
-  getopt1.$(OBJEXT) \
-  glyphuni.$(OBJEXT) \
-  htmlhint.$(OBJEXT) \
-  hypot.$(OBJEXT) \
-  iftoa.$(OBJEXT) \
-  invalid.$(OBJEXT) \
-  itoa.$(OBJEXT) \
-  lf.$(OBJEXT) \
-  lineno.$(OBJEXT) \
-  localcharset.$(OBJEXT) \
-  macropath.$(OBJEXT) \
-  matherr.$(OBJEXT) \
-  maxfilename.$(OBJEXT) \
-  maxpathname.$(OBJEXT) \
-  mksdir.$(OBJEXT) \
-  nametoindex.$(OBJEXT) \
-  new.$(OBJEXT) \
-  paper.$(OBJEXT) \
-  prime.$(OBJEXT) \
-  progname.$(OBJEXT) \
-  ptable.$(OBJEXT) \
-  quotearg.$(OBJEXT) \
-  relocate.$(OBJEXT) \
-  searchpath.$(OBJEXT) \
-  spawnvp.$(OBJEXT) \
-  string.$(OBJEXT) \
-  strsave.$(OBJEXT) \
-  symbol.$(OBJEXT) \
-  tmpfile.$(OBJEXT) \
-  tmpname.$(OBJEXT) \
-  unicode.$(OBJEXT) \
-  uniglyph.$(OBJEXT) \
-  uniuni.$(OBJEXT) \
-  version.$(OBJEXT) \
-  $(LIBOBJS)
-CCSRCS=\
-  $(srcdir)/assert.cpp \
-  $(srcdir)/change_lf.cpp \
-  $(srcdir)/cmap.cpp \
-  $(srcdir)/color.cpp \
-  $(srcdir)/cset.cpp \
-  $(srcdir)/device.cpp \
-  $(srcdir)/errarg.cpp \
-  $(srcdir)/error.cpp \
-  $(srcdir)/fatal.cpp \
-  $(srcdir)/filename.cpp \
-  $(srcdir)/font.cpp \
-  $(srcdir)/fontfile.cpp \
-  $(srcdir)/geometry.cpp \
-  $(srcdir)/glyphuni.cpp \
-  $(srcdir)/htmlhint.cpp \
-  $(srcdir)/hypot.cpp \
-  $(srcdir)/invalid.cpp \
-  $(srcdir)/lf.cpp \
-  $(srcdir)/lineno.cpp \
-  $(srcdir)/macropath.cpp \
-  $(srcdir)/maxfilename.cpp \
-  $(srcdir)/maxpathname.cpp \
-  $(srcdir)/mksdir.cpp \
-  $(srcdir)/mkstemp.cpp \
-  $(srcdir)/nametoindex.cpp \
-  $(srcdir)/new.cpp \
-  $(srcdir)/paper.cpp \
-  $(srcdir)/prime.cpp \
-  $(srcdir)/ptable.cpp \
-  $(srcdir)/relocate.cpp \
-  $(srcdir)/searchpath.cpp \
-  $(srcdir)/string.cpp \
-  $(srcdir)/strsave.cpp \
-  $(srcdir)/symbol.cpp \
-  $(srcdir)/tmpfile.cpp \
-  $(srcdir)/tmpname.cpp \
-  $(srcdir)/unicode.cpp \
-  $(srcdir)/uniglyph.cpp \
-  $(srcdir)/uniuni.cpp \
-  version.cpp
-CSRCS=\
-  $(srcdir)/fmod.c \
-  $(srcdir)/getcwd.c \
-  $(srcdir)/getopt.c \
-  $(srcdir)/getopt1.c \
-  $(srcdir)/iftoa.c \
-  $(srcdir)/itoa.c \
-  $(srcdir)/localcharset.c \
-  $(srcdir)/matherr.c \
-  $(srcdir)/progname.c \
-  $(srcdir)/putenv.c \
-  $(srcdir)/quotearg.c \
-  $(srcdir)/spawnvp.c \
-  $(srcdir)/strcasecmp.c \
-  $(srcdir)/strerror.c \
-  $(srcdir)/strncasecmp.c \
-  $(srcdir)/strtol.c \
-  $(srcdir)/../snprintf/snprintf.c
-GENSRCS=\
-  version.cpp
-RM=rm -f
-
-src_version=`cat $(top_srcdir)/VERSION`
-src_revision=`cat $(top_srcdir)/REVISION`
-
-version.cpp: $(top_srcdir)/VERSION $(top_srcdir)/REVISION
-       @echo Making version.cpp
-       @echo const char \*version_string = \"$(src_version)\"\; >$@
-       @echo const char \*revision_string = \"$(src_revision)\"\; >>$@
-       @echo extern \"C\" const char \*Version_string = 
\"$(src_version).$(src_revision)\"\; \
-         | sed -e 's/\.0\"/\"/' >>$@
-
-# We have to avoid $(COMPILE.c) since we must not use groff's `assert.h'
-snprintf.$(OBJEXT): $(srcdir)/../snprintf/snprintf.c
-       $(CC) -c $(CDEFINES) $(CFLAGS) $(CPPFLAGS) \
-         $(srcdir)/../snprintf/snprintf.c
-
-# Data for localcharset.c.  Taken from libiconv/libcharset.
-
-all: charset.alias ref-add.sed ref-del.sed
-
-charset.alias: $(srcdir)/config.charset
-       $(SHELL) $(srcdir)/config.charset '$(HOST)' > t-$@
-       mv t-$@ $@
-
-PACKAGE=groff
-
-ref-add.sed : $(srcdir)/ref-add.sin
-       sed -e '/^#/d' \
-           -e 's/@''PACKAGE''@/$(PACKAGE)/g' $(srcdir)/ref-add.sin > t-$@
-       mv t-$@ $@
-
-ref-del.sed : $(srcdir)/ref-del.sin
-       sed -e '/^#/d' \
-           -e 's/@''PACKAGE''@/$(PACKAGE)/g' $(srcdir)/ref-del.sin > t-$@
-       mv t-$@ $@
-
-MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
-
-install_data: install_charset_data
-install_charset_data:
-       -test $(GLIBC21) != no || $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
-       if test -f $(DESTDIR)$(libdir)/charset.alias; then \
-         sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias \
-           > $(DESTDIR)$(libdir)/t-charset.alias; \
-         $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias \
-           $(DESTDIR)$(libdir)/charset.alias; \
-         $(RM) $(DESTDIR)$(libdir)/t-charset.alias; \
-       else \
-         if test $(GLIBC21) = no; then \
-           sed -f ref-add.sed charset.alias \
-             > $(DESTDIR)$(libdir)/t-charset.alias; \
-           $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias \
-             $(DESTDIR)$(libdir)/charset.alias; \
-           $(RM) $(DESTDIR)$(libdir)/t-charset.alias; \
-         fi; \
-       fi
-
-uninstall_sub: uninstall_charset_data
-uninstall_charset_data:
-       -if test -f $(DESTDIR)$(libdir)/charset.alias; then \
-         sed -f ref-del.sed $(DESTDIR)$(libdir)/charset.alias \
-           > $(DESTDIR)$(libdir)/t-charset.alias; \
-         if grep '^# Packages using this file: $$' \
-                 $(DESTDIR)$(libdir)/t-charset.alias > /dev/null; then \
-           $(RM) $(DESTDIR)$(libdir)/charset.alias; \
-         else \
-           $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias \
-             $(DESTDIR)$(libdir)/charset.alias; \
-         fi; \
-         $(RM) $(DESTDIR)$(libdir)/t-charset.alias; \
-       fi
-
-clean: clean_charset
-clean_charset:
-       $(RM) charset.alias ref-add.sed ref-del.sed
-
-########################################################################
-# Emacs settings
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
diff --git a/src/libs/libgroff/libgroff.am b/src/libs/libgroff/libgroff.am
new file mode 100644
index 0000000..66f8f8c
--- /dev/null
+++ b/src/libs/libgroff/libgroff.am
@@ -0,0 +1,115 @@
+# 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/>.
+
+libgroff_srcdir = $(top_srcdir)/src/libs/libgroff
+noinst_LIBRARIES += libgroff.a
+libgroff_a_CPPFLAGS = \
+  $(AM_CPPFLAGS) \
+  -D__GETOPT_PREFIX=groff_ \
+  -DENABLE_RELOCATABLE=1 \
+  -DLIBDIR=\"$(libdir)\"
+
+# Build from OBJS
+libgroff_a_SOURCES = \
+  src/libs/libgroff/assert.cpp \
+  src/libs/libgroff/change_lf.cpp \
+  src/libs/libgroff/cmap.cpp \
+  src/libs/libgroff/color.cpp \
+  src/libs/libgroff/cset.cpp\
+  src/libs/libgroff/device.cpp \
+  src/libs/libgroff/errarg.cpp \
+  src/libs/libgroff/error.cpp \
+  src/libs/libgroff/fatal.cpp \
+  src/libs/libgroff/filename.cpp \
+  src/libs/libgroff/font.cpp \
+  src/libs/libgroff/fontfile.cpp \
+  src/libs/libgroff/geometry.cpp \
+  src/libs/libgroff/getopt.c \
+  src/libs/libgroff/getopt1.c \
+  src/libs/libgroff/glyphuni.cpp \
+  src/libs/libgroff/htmlhint.cpp \
+  src/libs/libgroff/hypot.cpp \
+  src/libs/libgroff/iftoa.c \
+  src/libs/libgroff/invalid.cpp \
+  src/libs/libgroff/itoa.c \
+  src/libs/libgroff/lf.cpp \
+  src/libs/libgroff/lineno.cpp \
+  src/libs/libgroff/localcharset.c \
+  src/libs/libgroff/macropath.cpp \
+  src/libs/libgroff/matherr.c \
+  src/libs/libgroff/maxfilename.cpp \
+  src/libs/libgroff/maxpathname.cpp \
+  src/libs/libgroff/mksdir.cpp \
+  src/libs/libgroff/nametoindex.cpp \
+  src/libs/libgroff/new.cpp \
+  src/libs/libgroff/paper.cpp \
+  src/libs/libgroff/prime.cpp \
+  src/libs/libgroff/progname.c \
+  src/libs/libgroff/ptable.cpp \
+  src/libs/libgroff/quotearg.c \
+  src/libs/libgroff/relocate.cpp \
+  src/libs/libgroff/searchpath.cpp \
+  src/libs/libgroff/spawnvp.c \
+  src/libs/libgroff/string.cpp \
+  src/libs/libgroff/strsave.cpp \
+  src/libs/libgroff/symbol.cpp \
+  src/libs/libgroff/tmpfile.cpp \
+  src/libs/libgroff/tmpname.cpp \
+  src/libs/libgroff/unicode.cpp \
+  src/libs/libgroff/uniglyph.cpp \
+  src/libs/libgroff/uniuni.cpp \
+  src/libs/libgroff/relocatable.h
+nodist_libgroff_a_SOURCES = src/libs/libgroff/version.cpp
+
+src_version=`cat $(top_srcdir)/VERSION`
+src_revision=`cat $(top_srcdir)/REVISION`
+
+# .o files have a 'libgroff_a-' prefix because we set libgroff_a_CPPFLAGS
+src/libs/libgroff/libgroff_a-device.$(OBJEXT): defs.h
+src/libs/libgroff/libgroff_a-fontfile.$(OBJEXT): defs.h
+src/libs/libgroff/libgroff_a-macropath.$(OBJEXT): defs.h
+src/libs/libgroff/libgroff_a-relocate.$(OBJEXT): defs.h
+
+src/libs/libgroff/version.cpp: $(top_srcdir)/VERSION $(top_srcdir)/REVISION
+       @echo Making version.cpp
+       @echo const char \*version_string = \"$(src_version)\"\; >$@
+       @echo const char \*revision_string = \"$(src_revision)\"\; >>$@
+       @echo extern \"C\" { >>$@
+       @echo const char \*Version_string = 
\"$(src_version).$(src_revision)\"\; >>$@
+       @echo } >>$@ \
+         | sed -e 's/\.0\"/\"/' >>$@
+
+# Data for localcharset.c.  Taken from libiconv/libcharset.
+
+LIBGROFF_PACKAGE = groff
+
+all: charset.alias ref-add.sed ref-del.sed
+
+charset.alias: $(libgroff_srcdir)/config.charset
+       $(SHELL) $(libgroff_srcdir)/config.charset '$(HOST)' > t-$@
+       mv t-$@ $@
+
+ref-add.sed : $(libgroff_srcdir)/ref-add.sin
+       sed -e '/^#/d' \
+           -e 's/@''PACKAGE''@/$(LIBGROFF_PACKAGE)/g' 
$(libgroff_srcdir)/ref-add.sin > t-$@
+       mv t-$@ $@
+
+ref-del.sed : $(libgroff_srcdir)/ref-del.sin
+       sed -e '/^#/d' \
+           -e 's/@''PACKAGE''@/$(LIBGROFF_PACKAGE)/g' 
$(libgroff_srcdir)/ref-del.sin > t-$@
+       mv t-$@ $@
diff --git a/src/libs/libxutil/Makefile.sub b/src/libs/libxutil/libxutil.am
similarity index 58%
rename from src/libs/libxutil/Makefile.sub
rename to src/libs/libxutil/libxutil.am
index df8eb02..a6760e2 100644
--- a/src/libs/libxutil/Makefile.sub
+++ b/src/libs/libxutil/libxutil.am
@@ -1,11 +1,9 @@
-# Makefile.sub for `libxutil'
+# Automake rules for `libxutil'
 #
-# File position: <groff-source>/src/libs/libxutil/Makefile.sub
+# File position: <groff-source>/src/libs/libxutil/libxutil.am
 #
 # Copyright (C) 2014 Free Software Foundation, Inc.
 #
-# This file is part of `font utf8' 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 as published by
 # the Free Software Foundation, either version 2 of the License, or
@@ -22,21 +20,10 @@
 #
 ########################################################################
 
-LIB=xutil
-EXTRA_CFLAGS=$(X_CFLAGS)
-OBJS=\
-  DviChar.$(OBJEXT) \
-  XFontName.$(OBJEXT) \
-  xmalloc.$(OBJEXT)
-CSRCS=\
-  $(srcdir)/DviChar.c \
-  $(srcdir)/XFontName.c \
-  $(srcdir)/xmalloc.c
-
-########################################################################
-# Emacs settings
-########################################################################
-#
-# Local Variables:
-# mode: makefile
-# End:
+# TODO: X management
+noinst_LIBRARIES += libxutil.a
+libxutil_a_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS)
+libxutil_a_SOURCES = \
+  src/libs/libxutil/DviChar.c \
+  src/libs/libxutil/XFontName.c \
+  src/libs/libxutil/xmalloc.c



reply via email to

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