Build with X11

This commit is contained in:
Takashi Kokubun 2016-11-29 00:22:32 +09:00
parent 5a78ce246c
commit b2ddabbe25
4 changed files with 6 additions and 13 deletions

View File

@ -1,7 +1,4 @@
current_dir := $(shell pwd)
LD=gcc
LDFLAGS=-lX11
OBJS=src/main.o
.PHONY: all
all: xkremap
@ -13,5 +10,5 @@ mruby:
curl -L --fail --retry 3 --retry-delay 1 https://github.com/mruby/mruby/archive/1.2.0.tar.gz -s -o - | tar zxf -
mv mruby-1.2.0 $@
mruby/build/host/bin/xkremap: mruby build_config.rb tools/xkremap/xkremap.c
mruby/build/host/bin/xkremap: mruby build_config.rb tools/xkremap/main.c
cd mruby && MRUBY_CONFIG="$(current_dir)/build_config.rb" make

View File

@ -2,8 +2,13 @@ MRuby::Build.new do |conf|
toolchain :gcc
conf.gem File.expand_path(File.dirname(__FILE__))
conf.instance_eval do
# Allow showing backtrace.
@mrbc.compile_options += ' -g'
end
conf.linker do |linker|
linker.libraries += %w(X11)
end
end

View File

@ -132,7 +132,6 @@ void
event_loop(Display *display)
{
XEvent event;
XWindowAttributes attrs;
while (1) {
XNextEvent(display, &event);
switch (event.type) {

View File

@ -1,8 +0,0 @@
#include <stdio.h>
int
main(void)
{
printf("Hello xkremap!\n");
return 0;
}