Revert "Changed the parser such that it understands all defined functions"
[ginac.git] / ginac / Makefile.am
index 03e1845b6d27936e8c4824fd799f456b50dcdbb1..bf20afc4b3e807c9b08589da676cde97b226a2d0 100644 (file)
@@ -13,6 +13,7 @@ libginac_la_SOURCES = add.cpp archive.cpp basic.cpp clifford.cpp color.cpp \
   parser/parse_binop_rhs.cpp \
   parser/parser.cpp \
   parser/parse_context.cpp \
+  parser/builtin_fcns.cpp \
   parser/lexer.cpp \
   parser/lexer.h \
   parser/parser_compat.cpp \
@@ -66,7 +67,22 @@ ginacinclude_HEADERS = ginac.h add.h archive.h assertion.h basic.h class_info.h
   parser/parser.h \
   parser/parse_context.h
 
-EXTRA_DIST = function.pl version.h.in
+EXTRA_DIST = function.pl version.h.in \
+parser/default_reader.tpl parser/builtin_fcns.def
+
+# Files produced by autogen(1) from templates
+$(srcdir)/parser/builtin_fcns.cpp: $(srcdir)/parser/builtin_fcns.def $(srcdir)/parser/default_reader.tpl
+       set -e; if [ -n "$(AUTOGEN)" ]; then \
+               cd $(srcdir)/parser; \
+               $(AUTOGEN) -T default_reader.tpl builtin_fcns.def; \
+       elif [ -f $@ ]; then \
+               echo "WARNING: AutoGen is not available, the \"$@\" file WON'T be re-generated"; \
+       else \
+               echo "*** ERROR: the \"$@\" file does not exist, and AutoGen is not installed on your system"; \
+               echo "***        Please install AutoGen (http://www.gnu.org/software/autogen)"; \
+               exit 1; \
+       fi
+               
 
 # Files which are generated by perl scripts
 $(srcdir)/function.h $(srcdir)/function.cpp: $(srcdir)/function.pl