diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-06 14:33:27 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-04-23 21:47:26 -0400 |
commit | d68b342b03dea3ddd675200ae2ee82fc36160def (patch) | |
tree | 97572b7c78eb4503be46884986e341ca5d4dd3ed | |
parent | 527d43d7012d9f9a33be18b51306487edfe5ae57 (diff) |
meson: add TAGS target
Quite necessary for all the emacs users out there ;)
v2:
- fix error with etags or git are not found
v3:
- move the definition of git and etags up so it's available for man/
-rw-r--r-- | meson.build | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 506b43dfca..20c6cd1a8b 100644 --- a/meson.build +++ b/meson.build @@ -382,6 +382,8 @@ grep = find_program('grep') awk = find_program('awk') m4 = find_program('/usr/bin/m4') stat = find_program('stat') +git = find_program('git', required : false) +etags = find_program('etags', required : false) # if -Dxxx-path option is found, use that. Otherwise, check in $PATH, # /usr/sbin, /sbin, and fall back to the default from middle column. @@ -1855,3 +1857,20 @@ install_data('README', 'LICENSE.LGPL2.1', 'src/libsystemd/sd-bus/GVARIANT-SERIALIZATION', install_dir : docdir) + +############################################################ + +if git.found() and etags.found() + all_files = run_command( + git, + ['--git-dir=@0@/.git'.format(meson.source_root()), + 'ls-files', + ':/*.[ch]']) + all_files = files(all_files.stdout().split()) + + custom_target( + 'TAGS', + output : 'TAGS', + input : all_files, + command : [etags, '-o', '@OUTPUT@'] + all_files) +endif |