]> git.lyx.org Git - lyx.git/commitdiff
Improve autotools support for generating LFUNs.lyx
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 13 Feb 2014 12:26:18 +0000 (13:26 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 13 Feb 2014 12:28:41 +0000 (13:28 +0100)
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.

Makefile.am
development/tools/gen_lfuns.py

index 5c9e7882b80fb22e2be730ba38437cc3f4351f23..7388a4ef50654bc2d3cbcfdf266813c811e7591a 100644 (file)
@@ -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
index acb2c17818048b2e6217524584d319956117cc65..e8a91062dd7d11b8c52a2b6cfa08d4a31a2c8274 100755 (executable)
@@ -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: