commit 4ec02b46b5f6f3aac77ff636ed7020902b0e59ab
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Thu Feb 13 13:26:18 2014 +0100
Improve autotools support for generating LFUNs.lyx
The tqrget now works properly when out of source directory qnd uses the
$(PYTHON) variable. Also, the use of the error() function has been fixed in the
gen_lfun.py script.
diff --git a/Makefile.am b/Makefile.am
index 5c9e788..7388a4e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -48,8 +48,10 @@ rpmdist: dist
doxydoc:
cd sourcedoc; $(MAKE) doxydoc
-lfundoc:
- development/tools/gen_lfuns.py src/LyXAction.cpp > lib/doc/LFUNs.lyx
+lfundoc: $(srcdir)/lib/doc/LFUNs.lyx
+
+$(srcdir)/lib/doc/LFUNs.lyx: $(srcdir)/development/tools/gen_lfuns.py
$(srcdir)/src/LyXAction.cpp
+ $(AM_V_GEN)$(PYTHON) $^ >$@ 2>/dev/null
keystest:
development/keystest/lyx_make.sh
diff --git a/development/tools/gen_lfuns.py b/development/tools/gen_lfuns.py
index acb2c17..e8a9106 100755
--- a/development/tools/gen_lfuns.py
+++ b/development/tools/gen_lfuns.py
@@ -377,14 +377,14 @@ def write_sections(file,lfuns):
write_fields(file, lf)
def main(argv):
- # parse command line arguments
+ # parse command line arguments
script_path, script_name = os.path.split(argv[0])
if len(argv) < 2:
error(usage(script_name))
# input file
lyxaction_path = argv[1]
- if not os.path.exists(lyxaction_path):
- error(script_name + ": %s is not a valid path" % lyxaction_path,
usage(argv[0]))
+ if not os.path.isfile(lyxaction_path):
+ error(script_name + ": %s is not a valid path" % lyxaction_path)
# output file
if len(argv) == 3: