1# Id: Makefile.am,v 1.8 2004/10/28 14:03:27 karl Exp 
2# Makefile.am for texinfo/info.
3# Run automake in .. to produce Makefile.in from this.
4#
5# This file is free software; as a special exception the author gives
6# unlimited permission to copy and/or distribute it, with or without
7# modifications, as long as this notice is preserved.
8#
9# This program is distributed in the hope that it will be useful, but
10# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
11# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13# Use `ginfo' for building to avoid confusion with the standard `info'
14# target.  Removes the `g' in the install rule before applying any
15# user-specified name transformations.
16bin_PROGRAMS = ginfo infokey
17transform = s/ginfo/info/; $(program_transform_name)
18
19localedir = $(datadir)/locale
20infodir2 = $(datadir)/info
21
22# -I. for funs.h.
23# Automake puts -I.. and -I$(srcdir) into DEFS by default, but
24# we need to override it, so include them ourselves.
25INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
26DEFS += -DLOCALEDIR=\"$(localedir)\" -DINFODIR=\"$(infodir)\" \
27	-DINFODIR2=\"$(infodir2)\"
28LDADD = ../lib/libtxi.a $(TERMLIBS) $(LIBINTL)
29
30EXTRA_DIST = README pcterm.c
31
32ginfo_SOURCES = dir.c display.c display.h doc.h dribble.c dribble.h \
33  echo-area.c echo-area.h \
34  filesys.c filesys.h footnotes.c footnotes.h gc.c gc.h \
35  indices.c indices.h info-utils.c info-utils.h info.c info.h infodoc.c \
36  infomap.c infomap.h m-x.c man.c man.h nodemenu.c nodes.c nodes.h \
37  search.c search.h session.c session.h signals.c signals.h \
38  termdep.h terminal.c terminal.h tilde.c tilde.h \
39  variables.c variables.h window.c window.h
40nodist_ginfo_SOURCES = doc.c funs.h
41infokey_SOURCES = infokey.c infokey.h key.h
42nodist_infokey_SOURCES = key.c funs.h
43
44# The files `doc.c', `key.c' and `funs.h' are created by ./makedoc run over the
45# source files which contain DECLARE_INFO_COMMAND.  `funs.h' is a header file
46# listing the functions found.  `doc.c' is a structure containing pointers
47# to those functions along with completable names and documentation strings.
48#
49generated_sources = doc.c key.c funs.h
50
51# We need a linear ordering to prevent race condition in parallel make.
52# See the node ``(automake)Multiple Outputs'' for an explanation.
53doc.c: key.c
54key.c: funs.h
55
56# These files are not distributed.
57DISTCLEANFILES = $(generated_sources)
58
59noinst_PROGRAMS = makedoc
60makedoc_SOURCES = makedoc.c
61
62# Files with Info commands defined that makedoc should read.
63cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
64  $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
65  $(srcdir)/footnotes.c $(srcdir)/variables.c
66
67# The $(EXEEXT) should be added by Automake, but isn't. Fine.
68$(generated_sources): makedoc$(EXEEXT) $(cmd_sources)
69	rm -f $(generated_sources)
70	$(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources)
71
72# The following hack is necessary to hint make before the automatic
73# dependencies are built.
74BUILT_SOURCES = funs.h
75