summaryrefslogtreecommitdiff
path: root/ext/io/console/depend
blob: 40eacd21e1021f04d8c8a93a04f42e22ac5497b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$(OBJS): $(HDRS) $(ruby_headers) \
  $(VK_HEADER) \
  $(hdrdir)/ruby/io.h \
  $(hdrdir)/ruby/encoding.h \
  $(hdrdir)/ruby/oniguruma.h

win32_vk.inc: win32_vk.list

.list.inc:
	( \
	$(RUBY) -anF, \
	-e 'BEGIN {puts "#define UNDEFINED_VK (unsigned short)-1"}' \
	-e 'n=$$F[1] and (n.strip!; /\AVK_/=~n) and' \
	-e   'puts(%[#ifndef #{n}\n# define #{n} UNDEFINED_VK\n#endif])' \
	$< && \
	gperf --ignore-case -E -C -P -p -j1 -i 1 -g -o -t -K ofs -N console_win32_vk -k* $< \
	| sed 's/(int)(long)&((\(struct stringpool_t\) *\*)0)->\(stringpool_[a-z0-9]*\)/offsetof(\1, \2)/g' \
	) > $(@F)

.SUFFIXES: .chksum .list .inc

.list.chksum:
	@$(RUBY) -I$(top_srcdir)/tool -rchecksum \
	    -e "Checksum.update(ARGV) {|k|k.copy(k.target) rescue k.make(k.target)}" \
	    -- --make=$(MAKE) -I$(srcdir) $(<F) $(@F:.chksum=.inc)