Merge pull request #31 from hanachin/generate_x11_constants_from_headers_at_build_time

Generate X11 constants from headers at build-time.
pull/36/head
Takashi Kokubun 6 years ago committed by GitHub
commit 6160899fec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
.gitignore vendored

@ -2,3 +2,5 @@
/mruby
tags
TAGS
src/x11_constants.inc
src/x11_constants_XF86.inc

@ -22,5 +22,11 @@ mruby:
git clone https://github.com/mruby/mruby
git -C mruby reset --hard $(REVISION)
mruby/build/host/bin/xremap: mruby build_config.rb $(CSRCS) $(MRBSRCS) $(MRBCSRCS)
src/x11_constants.inc:
cat /usr/include/X11/keysymdef.h | ruby -e 'puts STDIN.read.split("\n").select {|l| l.match(/\A(#define XK_|#ifdef|#endif)/) }.map{|l| l.match(/\A#define XK_/) ? %Q[ define_x11_const(#{l.split(" ")[1]});] : l }.join("\n")' > src/x11_constants.inc
src/x11_constants_XF86.inc:
cat /usr/include/X11/X.h | ruby -e 'puts STDIN.read.split("\n").select {|l| l.start_with?("#")}[2..-2].map{|l| l.start_with?("#define") ? %Q[ define_x11_const(#{l.split(" ")[1]});] : l}' > src/x11_constants_XF86.inc
mruby/build/host/bin/xremap: mruby build_config.rb src/x11_constants.inc src/x11_constants_XF86.inc $(CSRCS) $(MRBSRCS) $(MRBCSRCS)
cd mruby && MRUBY_CONFIG="$(current_dir)/build_config.rb" make

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save