tools: move generate-gperfs.py to tools/
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Nov 2018 11:19:41 +0000 (20:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 28 Nov 2018 11:19:41 +0000 (20:19 +0900)
meson.build
src/basic/generate-gperfs.py [deleted file]
src/basic/meson.build
tools/generate-gperfs.py [new file with mode: 0755]

index 8b51d032b814e8776fea54730bf917198762bdd6..210d5d64ee756b3a95dc06ba9b99f82594c54226 100644 (file)
@@ -1388,6 +1388,8 @@ includes = include_directories('src/basic',
 
 add_project_arguments('-include', 'config.h', language : 'c')
 
+generate_gperfs = find_program('tools/generate-gperfs.py')
+
 subdir('po')
 subdir('catalog')
 subdir('src/systemd')
diff --git a/src/basic/generate-gperfs.py b/src/basic/generate-gperfs.py
deleted file mode 100755 (executable)
index aca9ab1..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/usr/bin/env python3
-
-"""Generate %-from-name.gperf from %-list.txt
-"""
-
-import sys
-
-name, prefix, input = sys.argv[1:]
-
-print("""\
-%{
-#if __GNUC__ >= 7
-_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
-#endif
-%}""")
-print("""\
-struct {}_name {{ const char* name; int id; }};
-%null-strings
-%%""".format(name))
-
-for line in open(input):
-    print("{0}, {1}{0}".format(line.rstrip(), prefix))
index 0b27ffda7d94f0993a60a7a0a3ff8d5dbe6bc595..38537920b749cda6143d27a52204daf29c8496ca 100644 (file)
@@ -179,8 +179,6 @@ basic_sources = files('''
 
 missing_h = files('missing.h')
 
-generate_gperfs = find_program('generate-gperfs.py')
-
 generate_af_list = find_program('generate-af-list.sh')
 af_list_txt = custom_target(
         'af-list.txt',
diff --git a/tools/generate-gperfs.py b/tools/generate-gperfs.py
new file mode 100755 (executable)
index 0000000..aca9ab1
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+
+"""Generate %-from-name.gperf from %-list.txt
+"""
+
+import sys
+
+name, prefix, input = sys.argv[1:]
+
+print("""\
+%{
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \\"-Wimplicit-fallthrough\\"")
+#endif
+%}""")
+print("""\
+struct {}_name {{ const char* name; int id; }};
+%null-strings
+%%""".format(name))
+
+for line in open(input):
+    print("{0}, {1}{0}".format(line.rstrip(), prefix))