aboutsummaryrefslogtreecommitdiffstats
path: root/ext/io/console/depend
blob: b3aa1b5f74053b03af71f0c7efdd1292a740f056 (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
26
27
$(OBJS): $(HDRS) $(ruby_headers) \
  $(VK_HEADER) $(VK_HEADER:.chksum=.h) \
  $(hdrdir)/ruby/io.h \
  $(hdrdir)/ruby/encoding.h \
  $(hdrdir)/ruby/oniguruma.h

win32_vk.inc: win32_vk.list

win32_vk.h: win32_vk.list

.list.inc:
	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)

.list.h:
	$(RUBY) -anF, \
	-e '(n=$$F[1]) and (n.strip!; /\AVK_/=~n) and' \
	-e   'puts %[#ifndef #{n}\n# define #{n} (unsigned short)-1\n#endif]' \
	$< > $@

.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)