diff --git a/Makefile b/Makefile index cc223cf..68ad91c 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ shader.h : shader.frag Makefile mono ./shader_minifier.exe --preserve-externals shader.frag -o shader.h # not using `pkg-config --libs` here because it will include too many libs -gtk-webkit.elf : gtk-webkit.c Makefile +gtk-webkit.elf : gtk-webkit.c index.html.inc Makefile gcc -o $@ $< `pkg-config --cflags webkit2gtk-4.0` -lgobject-2.0 -lgtk-3 -lwebkit2gtk-4.0 -no-pie -fno-plt -Os -std=gnu11 -nostartfiles -nostdlib gtk-opengl.elf : gtk-opengl.c shader.h Makefile @@ -28,6 +28,9 @@ gtk-opengl : gtk-opengl_opt.elf.packed xlib-opengl : xlib-opengl_opt.elf.packed mv $< $@ +index.html.inc : index.html + cat index.html | xxd -i > index.html.inc + echo ", 0" >> index.html.inc #all the rest of these rules just takes a compiled elf file and generates a packed version of it with vondehi %_opt.elf : %.elf Makefile diff --git a/gtk-webkit.c b/gtk-webkit.c index 8c14cbc..9c83ce7 100644 --- a/gtk-webkit.c +++ b/gtk-webkit.c @@ -22,7 +22,9 @@ gboolean on_load_changed(WebKitWebView *web_view, WebKitLoadEvent load_event, Gt return TRUE; } -static char* html = "this is an html page! 😊
with webgl!"; +static char html[] = { +#include "index.html.inc" +}; void _start() { asm volatile("sub $8, %rsp\n"); diff --git a/index.html b/index.html new file mode 100644 index 0000000..bc280e2 --- /dev/null +++ b/index.html @@ -0,0 +1,5 @@ + + + \ No newline at end of file