summaryrefslogtreecommitdiff
path: root/ext/io/console
diff options
context:
space:
mode:
Diffstat (limited to 'ext/io/console')
-rw-r--r--ext/io/console/depend13
-rw-r--r--ext/io/console/extconf.rb2
-rw-r--r--ext/io/console/win32_vk.chksum1
3 files changed, 13 insertions, 3 deletions
diff --git a/ext/io/console/depend b/ext/io/console/depend
index c961843bcc..1e485fd194 100644
--- a/ext/io/console/depend
+++ b/ext/io/console/depend
@@ -1,3 +1,5 @@
+WIN32_VK_HEADER = {$(srcdir)}win32_vk.chksum
+
$(OBJS): $(HDRS) $(ruby_headers) \
$(VK_HEADER) \
$(hdrdir)/ruby/io.h \
@@ -6,5 +8,12 @@ $(OBJS): $(HDRS) $(ruby_headers) \
win32_vk.h: win32_vk.list
-.list.h:
- gperf --ignore-case -E -C -P -p -j1 -i 1 -g -o -t -K ofs -N console_win32_vk -k* --output-file=$@ $<
+{$(srcdir)}.list.h:
+ gperf --ignore-case -E -C -P -p -j1 -i 1 -g -o -t -K ofs -N console_win32_vk -k* --output-file=$(@F) $<
+
+.SUFFIXES: .chksum .list
+
+{$(srcdir)}.list.chksum:
+ @$(RUBY) -I$(top_srcdir)/tool -rchecksum \
+ -e "Checksum.update(ARGV) {|k,f|k.copy(f) rescue k.make(f)}" \
+ -- --make=$(MAKE) -I$(srcdir) $(<F) $(@F:.chksum=.h)
diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb
index 1658dc01eb..15fa798a4d 100644
--- a/ext/io/console/extconf.rb
+++ b/ext/io/console/extconf.rb
@@ -5,7 +5,7 @@ hdr = nil
case
when macro_defined?("_WIN32", "")
# rb_w32_map_errno: 1.8.7
- vk_header = "win32_vk.h"
+ vk_header = "$(WIN32_VK_HEADER)"
when hdr = %w"termios.h termio.h".find {|h| have_header(h)}
have_func("cfmakeraw", hdr)
when have_header(hdr = "sgtty.h")
diff --git a/ext/io/console/win32_vk.chksum b/ext/io/console/win32_vk.chksum
new file mode 100644
index 0000000000..bc9fff7560
--- /dev/null
+++ b/ext/io/console/win32_vk.chksum
@@ -0,0 +1 @@
+src="win32_vk.list", len=3269, checksum=34076