summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-12-21 20:00:23 +0100
committerKevin Ryde <user42@zip.com.au>2001-12-21 20:00:23 +0100
commit6d80f3358dc064757d284ef209ea0a5a7dd9ef19 (patch)
tree57166d8e211daf3220f3da476b9b6c38d28ce754 /demos
parentf704868607192d3ea32ced028072536d9820de41 (diff)
downloadgmp-6d80f3358dc064757d284ef209ea0a5a7dd9ef19.tar.gz
* demos/calc/Makefile.am: Add calcread.c, calc-common.h, use $(YACC),
$(LEX) and $(LEXLIB).
Diffstat (limited to 'demos')
-rw-r--r--demos/calc/Makefile.am17
1 files changed, 11 insertions, 6 deletions
diff --git a/demos/calc/Makefile.am b/demos/calc/Makefile.am
index 33ada5167..d20021654 100644
--- a/demos/calc/Makefile.am
+++ b/demos/calc/Makefile.am
@@ -23,11 +23,14 @@
AUTOMAKE_OPTIONS = gnu no-dependencies $(top_builddir)/ansi2knr
INCLUDES = -I$(top_srcdir)
-LDADD = $(top_builddir)/libgmp.la
+
+# $(LEXLIB) seems to be unnecessary when using flex, but put it here for the
+# benefit of anyone rebuilding using a standard lex.
+LDADD = $(top_builddir)/libgmp.la $(LIBREADLINE) $(LEXLIB)
EXTRA_DIST = calc.y calclex.l
EXTRA_PROGRAMS = calc
-calc_SOURCES = calc.c calclex.c calc.h
+calc_SOURCES = calc.c calclex.c calcread.c calc.h calc-common.h
CLEANFILES = $(EXTRA_PROGRAMS)
@@ -42,8 +45,10 @@ allprogs: $(EXTRA_PROGRAMS)
# Using "cd"s instead of a $(srcdir) path ensures $(srcdir) doesn't get into
# the "#line"s in the generated files.
#
-# FIXME: Automake yacc handling isn't quite right when building in a
-# separate object directory, hence the explicit rules used for now.
+# FIXME: Automake knows about .y and .l, but as of version 1.5 doesn't do
+# the right thing when building in a separate object directory, hence the
+# explicit rules. Not sure if these rules cover all the portability
+# problems that automake does.
#
# FIXME: With ansi2knr and no-dependencies, there doesn't seem any easy way
# to manually express that calclex$U.lo depends on calc.h. Making calclex.c
@@ -51,6 +56,6 @@ allprogs: $(EXTRA_PROGRAMS)
# unnecessary.
$(srcdir)/calclex.c: calclex.l calc.h
- cd $(srcdir); lex -ocalclex.c calclex.l
+ cd $(srcdir); $(LEX) -ocalclex.c calclex.l
$(srcdir)/calc.c $(srcdir)/calc.h: calc.y
- cd $(srcdir); yacc -d -ocalc.c calc.y
+ cd $(srcdir); $(YACC) -d -ocalc.c calc.y