aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-06-07 01:57:04 -0400
committerJustin M. Keyes <justinkz@gmail.com>2016-06-07 01:57:04 -0400
commitd9660184665a3e3bac5feecb4b4b5680012329d4 (patch)
treefeabcbb1df1390db22c08e9ae816c0533a16862e
parent999590b313ef32ca29c4ddba20c5b719730ee7ff (diff)
parent704b58e54abd1adaaa83f00dae7fdb0f385b428b (diff)
downloadrneovim-d9660184665a3e3bac5feecb4b4b5680012329d4.tar.gz
rneovim-d9660184665a3e3bac5feecb4b4b5680012329d4.tar.bz2
rneovim-d9660184665a3e3bac5feecb4b4b5680012329d4.zip
Merge #4878 'build: always regenerate help tags'
-rw-r--r--.gitignore15
-rw-r--r--Makefile4
-rw-r--r--runtime/CMakeLists.txt14
-rw-r--r--runtime/doc/Makefile22
-rw-r--r--runtime/doc/doctags.c83
-rw-r--r--test/functional/helpers.lua16
-rw-r--r--test/functional/legacy/expand_spec.lua7
7 files changed, 36 insertions, 125 deletions
diff --git a/.gitignore b/.gitignore
index ccb2299582..766c323c34 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,27 +42,12 @@ tags
# luarocks, not added as a subtree because of the large number of blobs
/third-party/luarocks
-# luajit files
-/third-party/luajit/src/host/buildvm
-/third-party/luajit/src/host/buildvm_arch.h
-/third-party/luajit/src/host/minilua
-/third-party/luajit/src/jit/vmdef.lua
-/third-party/luajit/src/libluajit.a
-/third-party/luajit/src/lj_bcdef.h
-/third-party/luajit/src/lj_ffdef.h
-/third-party/luajit/src/lj_folddef.h
-/third-party/luajit/src/lj_libdef.h
-/third-party/luajit/src/lj_recdef.h
-/third-party/luajit/src/lj_vm.s
-/third-party/luajit/src/luajit
-
# local make targets
local.mk
# runtime/doc
/runtime/doc/*.html
/runtime/doc/tags.ref
-/runtime/doc/doctags
/runtime/doc/errors.log
# clint errors, generated by `make lint`
diff --git a/Makefile b/Makefile
index 5b04b74139..552a79466b 100644
--- a/Makefile
+++ b/Makefile
@@ -85,10 +85,10 @@ endif
mkdir -p build
touch $@
-oldtest: | nvim tags
+oldtest: | nvim helptags
+$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES)
-tags: | nvim
+helptags: | nvim
+$(BUILD_CMD) -C build runtime/doc/tags
functionaltest: | nvim
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt
index cad8da6ffb..4dbd193dab 100644
--- a/runtime/CMakeLists.txt
+++ b/runtime/CMakeLists.txt
@@ -31,7 +31,7 @@ add_custom_command(OUTPUT copy_docfiles
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
)
-add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
+add_custom_target(helptags
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
-u NONE
-i NONE
@@ -45,6 +45,18 @@ add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
)
+add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
+ DEPENDS
+ helptags
+)
+
+add_custom_target(doc_html
+ COMMAND make html
+ DEPENDS
+ ${GENERATED_HELP_TAGS}
+ WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
+)
+
add_custom_target(
runtime ALL
DEPENDS
diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile
index 7423e63673..3d10d0ea98 100644
--- a/runtime/doc/Makefile
+++ b/runtime/doc/Makefile
@@ -6,32 +6,14 @@
AWK = awk
-# Set to $(VIMTARGET) when executed from src/Makefile.
-VIMEXE = vim
-
DOCS = $(wildcard *.txt)
HTMLS = $(DOCS:.txt=.html)
.SUFFIXES:
.SUFFIXES: .c .o .txt .html
-all: tags html
-
-# Use Vim to generate the tags file. Can only be used when Vim has been
-# compiled and installed. Supports multiple languages.
-vimtags: $(DOCS)
- $(VIMEXE) -u NONE -es -c "helptags ++t ." -c quit
-
-# Use "doctags" to generate the tags file. Only works for English!
-tags: doctags $(DOCS)
- ./doctags $(DOCS) | LANG=C LC_ALL=C sort >tags
- uniq -d -2 tags
-
-doctags: doctags.c
- $(CC) doctags.c -o doctags
-
# Awk version of .txt to .html conversion.
-html: noerrors tags $(HTMLS)
+html: noerrors $(HTMLS)
@if test -f errors.log; then cat errors.log; fi
noerrors:
@@ -54,5 +36,5 @@ tags.ref tags.html: tags
$(AWK) -f maketags.awk tags >tags.html
clean:
- -rm -f doctags *.html tags.ref $(HTMLS) errors.log
+ -rm -f *.html tags.ref $(HTMLS) errors.log
diff --git a/runtime/doc/doctags.c b/runtime/doc/doctags.c
deleted file mode 100644
index 9213dd9c1e..0000000000
--- a/runtime/doc/doctags.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/* vim:set ts=4 sw=4:
- * this program makes a tags file for vim_ref.txt
- *
- * Usage: doctags vim_ref.txt vim_win.txt ... >tags
- *
- * A tag in this context is an identifier between stars, e.g. *c_files*
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#define LINELEN 200
-
- int
-main(argc, argv)
- int argc;
- char **argv;
-{
- char line[LINELEN];
- char *p1, *p2;
- char *p;
- FILE *fd;
-
- if (argc <= 1)
- {
- fprintf(stderr, "Usage: doctags docfile ... >tags\n");
- exit(1);
- }
- printf("help-tags\ttags\t1\n");
- while (--argc > 0)
- {
- ++argv;
- fd = fopen(argv[0], "r");
- if (fd == NULL)
- {
- fprintf(stderr, "Unable to open %s for reading\n", argv[0]);
- continue;
- }
- while (fgets(line, LINELEN, fd) != NULL)
- {
- p1 = strchr(line, '*'); /* find first '*' */
- while (p1 != NULL)
- {
- p2 = strchr(p1 + 1, '*'); /* find second '*' */
- if (p2 != NULL && p2 > p1 + 1) /* skip "*" and "**" */
- {
- for (p = p1 + 1; p < p2; ++p)
- if (*p == ' ' || *p == '\t' || *p == '|')
- break;
- /*
- * Only accept a *tag* when it consists of valid
- * characters, there is white space before it and is
- * followed by a white character or end-of-line.
- */
- if (p == p2
- && (p1 == line || p1[-1] == ' ' || p1[-1] == '\t')
- && (strchr(" \t\n\r", p[1]) != NULL
- || p[1] == '\0'))
- {
- *p2 = '\0';
- ++p1;
- printf("%s\t%s\t/*", p1, argv[0]);
- while (*p1)
- {
- /* insert backslash before '\\' and '/' */
- if (*p1 == '\\' || *p1 == '/')
- putchar('\\');
- putchar(*p1);
- ++p1;
- }
- printf("*\n");
- p2 = strchr(p2 + 1, '*'); /* find next '*' */
- }
- }
- p1 = p2;
- }
- }
- fclose(fd);
- }
- return 0;
-}
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 37b7bf664c..846ce72e14 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -345,10 +345,18 @@ local function rmdir(path)
end
for file in lfs.dir(path) do
if file ~= '.' and file ~= '..' then
- local ret, err = os.remove(path..'/'..file)
- if not ret then
- error('os.remove: '..err)
- return nil
+ local abspath = path..'/'..file
+ if lfs.attributes(abspath, 'mode') == 'directory' then
+ local ret = rmdir(abspath) -- recurse
+ if not ret then
+ return nil
+ end
+ else
+ local ret, err = os.remove(abspath)
+ if not ret then
+ error('os.remove: '..err)
+ return nil
+ end
end
end
end
diff --git a/test/functional/legacy/expand_spec.lua b/test/functional/legacy/expand_spec.lua
index 04701e8ba6..3da1416885 100644
--- a/test/functional/legacy/expand_spec.lua
+++ b/test/functional/legacy/expand_spec.lua
@@ -12,6 +12,13 @@ local function expected_empty()
end
describe('expand file name', function()
+ after_each(function()
+ helpers.rmdir('Xdir1')
+ helpers.rmdir('Xdir2')
+ helpers.rmdir('Xdir3')
+ helpers.rmdir('Xdir4')
+ end)
+
before_each(function()
clear()