CC=gcc CFLAGS=-Wall -g -I/usr/include/SDL2 LDFLAGS=-lSDL2 -lSDL2_ttf all: boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html # common notosans_regular_ttf.c: fonts/NotoSans-Regular.ttf (cd fonts && xxd -i NotoSans-Regular.ttf | tr A-Z a-z ) > notosans_regular_ttf.c notosans_regular_ttf.h: fonts/NotoSans-Regular.ttf (cd fonts && xxd -i NotoSans-Regular.ttf | sed "s/^\(.*[^ ]\) *=.*/extern \1\;/g" | grep extern | tr A-Z a-z ) > notosans_regular_ttf.h # windows build icon boxui-icon.ico: boxui-icon_256x256.png convert boxui-icon_256x256.png boxui-icon.ico boxui-icon.rc: boxui-icon.ico echo "1 ICON \"boxui-icon.ico\"" > boxui-icon.ico boxui-icon.o: boxui-icon.rc boxui-icon.ico x86_64-w64-mingw32-windres --preprocessor /usr/bin/cpp boxui-icon.rc boxui-icon.o # boxui.o: linux boxui.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h # boxui-windows.o: windows boxui-windows.o: boxui.c boxui.h sh -c ". zig/env.sh >/dev/null ; zig cc -I./zig/windows-msys2-mingw/include/ -I./zig/windows-msys2-mingw/include/SDL2 boxui.c -c -o boxui-windows.o -target x86_64-windows-gnu" # boxui-html.o: html5 boxui-html.o: boxui.c boxui.h sh -c ". emscripten/env.sh ; emcc -g -Wall -s USE_SDL=2 -s USE_SDL_TTF=2 boxui.c -c -o boxui-html.o" # boxui_demo_helloworld: linux boxui_demo_helloworld.o: boxui_demo_helloworld.c boxui.h boxui_demo_helloworld: boxui.o boxui_demo_helloworld.o # boxui_demo_helloworld: windows boxui_demo_helloworld.exe: boxui-icon.o boxui-windows.o boxui_demo_helloworld-windows.o sh -c ". zig/env.sh >/dev/null ; zig build-exe --subsystem windows boxui_demo_helloworld-windows.o boxui-windows.o boxui-icon.o -Lzig/windows-msys2-mingw/lib/ -Lzig/windows-msys2-mingw/lib/w32api -lSDL2 -lSDL2main -lSDL2_ttf -lfreetype -lgdi32 -lwinmm -lsetupapi -lmincore -lwindowsapp -limm32 -lversion -lgraphite2 -lpng -lbrotlidec -lbrotlicommon -lharfbuzz -lstdc++ -lbz2 -lz --name boxui_demo_helloworld -target x86_64-windows-gnu && rm boxui_demo_helloworld.lib boxui_demo_helloworld.pdb" # boxui_demo_helloworld: html5 boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_helloworld.c sh -c ". emscripten/env.sh ; emcc -g -Wall -s USE_SDL=2 -s USE_SDL_TTF=2 boxui_demo_helloworld.c -c -o boxui_demo_helloworld-html.o && emcc boxui_demo_helloworld-html.o -o boxui_demo_helloworld.html -s USE_SDL=2 -s USE_SDL_TTF=2 && sed s/PROGRAMNAME/boxui_demo_helloworld/g < boxui-html.template > boxui_demo_helloworld.html" clean: rm -f *.o boxui-icon.ico boxui-icon.rc \ notosans_regular_ttf.c notosans_regular_ttf.h \ boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html