Browse code

Port to SDL3

Dario Rodriguez authored on 16/10/2024 18:40:40
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 CC=gcc
2
-CFLAGS=-Wall -g -I/usr/include/SDL2 -DLINUX
3
-LDFLAGS=-lSDL2_ttf -lSDL2
2
+CFLAGS=-Wall -g -Isdl3/SDL-preview-3.1.3/include -Isdl3/SDL_ttf/include -DLINUX
3
+LDFLAGS=sdl3/libSDL3.so sdl3/libSDL3_ttf.so
4 4
 
5 5
 all: boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html
6 6
 
... ...
@@ -24,14 +24,14 @@ boxui-windows.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
24 24
 # boxui-html.o: html5
25 25
 
26 26
 boxui-html.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
27
-	sh -c ". toolchain-emscripten/env.sh ; emcc -g -Wall -s USE_SDL=2 -s USE_SDL_TTF=2 boxui.c -c -o boxui-html.o"
27
+	sh -c ". toolchain-emscripten/env.sh ; emcc -g -Wall -s USE_SDL=3 -s USE_SDL_TTF=3 boxui.c -c -o boxui-html.o"
28 28
 
29 29
 # boxui_demo_helloworld: linux
30 30
 
31 31
 boxui_demo_helloworld.o: boxui_demo_helloworld.c boxui.h
32 32
 
33 33
 boxui_demo_helloworld: boxui.o boxui_demo_helloworld.o
34
-	gcc boxui_demo_helloworld.o boxui.o -o boxui_demo_helloworld -lSDL2_ttf -lSDL2
34
+	gcc boxui_demo_helloworld.o boxui.o $(LDFLAGS) -o boxui_demo_helloworld 
35 35
 
36 36
 # boxui_demo_helloworld: windows
37 37
 
... ...
@@ -44,10 +44,10 @@ boxui_demo_helloworld.exe: boxui-icon_256x256.png boxui-windows.o boxui_demo_hel
44 44
 # boxui_demo_helloworld: html5
45 45
 
46 46
 boxui_demo_helloworld-html.o: boxui_demo_helloworld.c
47
-	sh -c ". toolchain-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"
47
+	sh -c ". toolchain-emscripten/env.sh ; emcc -g -Wall -s USE_SDL=3 -s USE_SDL_TTF=3 boxui_demo_helloworld.c -c -o boxui_demo_helloworld-html.o"
48 48
 
49 49
 boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_helloworld-html.o
50
-	sh -c ". toolchain-emscripten/env.sh ; emcc boxui_demo_helloworld-html.o boxui-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 && zip -pr boxui_demo_helloworld-html.zip boxui_demo_helloworld.html boxui_demo_helloworld.js boxui_demo_helloworld.wasm"
50
+	sh -c ". toolchain-emscripten/env.sh ; emcc boxui_demo_helloworld-html.o boxui-html.o -o boxui_demo_helloworld.html -s USE_SDL=3 -s USE_SDL_TTF=3 && sed s/PROGRAMNAME/boxui_demo_helloworld/g < boxui-html.template > boxui_demo_helloworld.html && zip -pr boxui_demo_helloworld-html.zip boxui_demo_helloworld.html boxui_demo_helloworld.js boxui_demo_helloworld.wasm"
51 51
 
52 52
 clean:
53 53
 	rm -f *.o *.js *.html *.wasm *.exe \
Browse code

fix Makefile for demo project on Linux so that it works in Debian 12 amd64

Dario Rodriguez authored on 28/07/2023 23:09:39
Showing 1 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 CC=gcc
2 2
 CFLAGS=-Wall -g -I/usr/include/SDL2 -DLINUX
3
-LDFLAGS=-lSDL2 -lSDL2_ttf
3
+LDFLAGS=-lSDL2_ttf -lSDL2
4 4
 
5 5
 all: boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html
6 6
 
... ...
@@ -31,6 +31,7 @@ boxui-html.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
31 31
 boxui_demo_helloworld.o: boxui_demo_helloworld.c boxui.h
32 32
 
33 33
 boxui_demo_helloworld: boxui.o boxui_demo_helloworld.o
34
+	gcc boxui_demo_helloworld.o boxui.o -o boxui_demo_helloworld -lSDL2_ttf -lSDL2
34 35
 
35 36
 # boxui_demo_helloworld: windows
36 37
 
Browse code

SimpMakefile: add boxui_demo_helloworld.exe to the clean target

Dario Rodriguez authored on 02/07/2023 14:49:55
Showing 1 changed files
... ...
@@ -51,4 +51,4 @@ boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_hellowor
51 51
 clean:
52 52
 	rm -f *.o *.js *.html *.wasm *.exe \
53 53
  notosans_regular_ttf.c notosans_regular_ttf.h \
54
- boxui_demo_helloworld boxui_demo_helloworld-html.zip
54
+ boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld-html.zip
Browse code

Simplify clean step in Makefile (we don't need to clean ico and rc files, toolchain-zig/link.sh does that by itself)

Dario Rodriguez authored on 02/07/2023 14:45:36
Showing 1 changed files
... ...
@@ -49,6 +49,6 @@ boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_hellowor
49 49
 	sh -c ". toolchain-emscripten/env.sh ; emcc boxui_demo_helloworld-html.o boxui-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 && zip -pr boxui_demo_helloworld-html.zip boxui_demo_helloworld.html boxui_demo_helloworld.js boxui_demo_helloworld.wasm"
50 50
 
51 51
 clean:
52
-	rm -f *.o *.js *.html *.wasm *.exe *.ico *.rc \
52
+	rm -f *.o *.js *.html *.wasm *.exe \
53 53
  notosans_regular_ttf.c notosans_regular_ttf.h \
54 54
  boxui_demo_helloworld boxui_demo_helloworld-html.zip
Browse code

Simplify compiling for windows in the Makefile example (using toolchain-zig/compile.sh and toolchain-zig/link.sh ).

Dario Rodriguez authored on 02/07/2023 14:41:21
Showing 1 changed files
... ...
@@ -12,18 +12,6 @@ notosans_regular_ttf.c: fonts/NotoSans-Regular.ttf
12 12
 notosans_regular_ttf.h: fonts/NotoSans-Regular.ttf
13 13
 	(cd fonts && xxd -i NotoSans-Regular.ttf | sed "s/^\(.*[^ ]\) *=.*/extern \1\;/g" | grep extern | tr A-Z a-z ) > notosans_regular_ttf.h
14 14
 
15
-
16
-# windows build icon
17
-
18
-boxui-icon.ico: boxui-icon_256x256.png
19
-	convert boxui-icon_256x256.png boxui-icon.ico
20
-
21
-boxui-icon.rc: boxui-icon.ico
22
-	echo "1 ICON \"boxui-icon.ico\"" > boxui-icon.rc
23
-
24
-boxui-icon.o: boxui-icon.rc boxui-icon.ico
25
-	x86_64-w64-mingw32-windres --preprocessor /usr/bin/cpp boxui-icon.rc boxui-icon.o
26
-
27 15
 # boxui.o: linux
28 16
 
29 17
 boxui.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
... ...
@@ -31,7 +19,7 @@ boxui.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
31 19
 # boxui-windows.o: windows
32 20
 
33 21
 boxui-windows.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
34
-	sh -c ". toolchain-zig/env.sh >/dev/null ; zig cc -I./toolchain-zig/windows-msys2-mingw/include/ -I./toolchain-zig/windows-msys2-mingw/include/SDL2 boxui.c -c -o boxui-windows.o -target x86_64-windows-gnu"
22
+	toolchain-zig/compile.sh boxui.c -c -o boxui-windows.o
35 23
 
36 24
 # boxui-html.o: html5
37 25
 
... ...
@@ -47,10 +35,10 @@ boxui_demo_helloworld: boxui.o boxui_demo_helloworld.o
47 35
 # boxui_demo_helloworld: windows
48 36
 
49 37
 boxui_demo_helloworld-windows.o: boxui_demo_helloworld.c boxui.h
50
-	sh -c ". toolchain-zig/env.sh >/dev/null ; zig cc -I./toolchain-zig/windows-msys2-mingw/include/ -I./toolchain-zig/windows-msys2-mingw/include/SDL2 boxui_demo_helloworld.c -c -o boxui_demo_helloworld-windows.o -target x86_64-windows-gnu"
38
+	toolchain-zig/compile.sh boxui_demo_helloworld.c -c -o boxui_demo_helloworld-windows.o
51 39
 
52
-boxui_demo_helloworld.exe: boxui-icon.o boxui-windows.o boxui_demo_helloworld-windows.o
53
-	sh -c ". toolchain-zig/env.sh >/dev/null ; zig build-exe --subsystem windows boxui_demo_helloworld-windows.o boxui-windows.o boxui-icon.o -Ltoolchain-zig/windows-msys2-mingw/lib/ -Ltoolchain-zig/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"
40
+boxui_demo_helloworld.exe: boxui-icon_256x256.png boxui-windows.o boxui_demo_helloworld-windows.o
41
+	toolchain-zig/link.sh -icon boxui-icon_256x256.png boxui_demo_helloworld.exe boxui-windows.o boxui_demo_helloworld-windows.o
54 42
 
55 43
 # boxui_demo_helloworld: html5
56 44
 
Browse code

Change toolchain directories and setup-scripts names.

Dario Rodriguez authored on 01/07/2023 15:15:29
Showing 1 changed files
... ...
@@ -31,12 +31,12 @@ boxui.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
31 31
 # boxui-windows.o: windows
32 32
 
33 33
 boxui-windows.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
34
-	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"
34
+	sh -c ". toolchain-zig/env.sh >/dev/null ; zig cc -I./toolchain-zig/windows-msys2-mingw/include/ -I./toolchain-zig/windows-msys2-mingw/include/SDL2 boxui.c -c -o boxui-windows.o -target x86_64-windows-gnu"
35 35
 
36 36
 # boxui-html.o: html5
37 37
 
38 38
 boxui-html.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
39
-	sh -c ". emscripten/env.sh ; emcc -g -Wall -s USE_SDL=2 -s USE_SDL_TTF=2 boxui.c -c -o boxui-html.o"
39
+	sh -c ". toolchain-emscripten/env.sh ; emcc -g -Wall -s USE_SDL=2 -s USE_SDL_TTF=2 boxui.c -c -o boxui-html.o"
40 40
 
41 41
 # boxui_demo_helloworld: linux
42 42
 
... ...
@@ -47,19 +47,18 @@ boxui_demo_helloworld: boxui.o boxui_demo_helloworld.o
47 47
 # boxui_demo_helloworld: windows
48 48
 
49 49
 boxui_demo_helloworld-windows.o: boxui_demo_helloworld.c boxui.h
50
-	sh -c ". zig/env.sh >/dev/null ; zig cc -I./zig/windows-msys2-mingw/include/ -I./zig/windows-msys2-mingw/include/SDL2 boxui_demo_helloworld.c -c -o boxui_demo_helloworld-windows.o -target x86_64-windows-gnu"
50
+	sh -c ". toolchain-zig/env.sh >/dev/null ; zig cc -I./toolchain-zig/windows-msys2-mingw/include/ -I./toolchain-zig/windows-msys2-mingw/include/SDL2 boxui_demo_helloworld.c -c -o boxui_demo_helloworld-windows.o -target x86_64-windows-gnu"
51 51
 
52 52
 boxui_demo_helloworld.exe: boxui-icon.o boxui-windows.o boxui_demo_helloworld-windows.o
53
-	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"
53
+	sh -c ". toolchain-zig/env.sh >/dev/null ; zig build-exe --subsystem windows boxui_demo_helloworld-windows.o boxui-windows.o boxui-icon.o -Ltoolchain-zig/windows-msys2-mingw/lib/ -Ltoolchain-zig/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"
54 54
 
55 55
 # boxui_demo_helloworld: html5
56 56
 
57 57
 boxui_demo_helloworld-html.o: boxui_demo_helloworld.c
58
-	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"
58
+	sh -c ". toolchain-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"
59 59
 
60 60
 boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_helloworld-html.o
61
-	sh -c ". emscripten/env.sh ; emcc boxui_demo_helloworld-html.o boxui-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 && zip -pr boxui_demo_helloworld-html.zip boxui_demo_helloworld.html boxui_demo_helloworld.js boxui_demo_helloworld.wasm"
62
-
61
+	sh -c ". toolchain-emscripten/env.sh ; emcc boxui_demo_helloworld-html.o boxui-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 && zip -pr boxui_demo_helloworld-html.zip boxui_demo_helloworld.html boxui_demo_helloworld.js boxui_demo_helloworld.wasm"
63 62
 
64 63
 clean:
65 64
 	rm -f *.o *.js *.html *.wasm *.exe *.ico *.rc \
Browse code

Add boxui_demo_helloworld. Write just enough of boxui.c to make it work and test the linux, windows and html5 toolchains

Dario Rodriguez authored on 17/06/2023 18:18:28
Showing 1 changed files
... ...
@@ -1,5 +1,5 @@
1 1
 CC=gcc
2
-CFLAGS=-Wall -g -I/usr/include/SDL2
2
+CFLAGS=-Wall -g -I/usr/include/SDL2 -DLINUX
3 3
 LDFLAGS=-lSDL2 -lSDL2_ttf
4 4
 
5 5
 all: boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html
... ...
@@ -19,7 +19,7 @@ boxui-icon.ico: boxui-icon_256x256.png
19 19
 	convert boxui-icon_256x256.png boxui-icon.ico
20 20
 
21 21
 boxui-icon.rc: boxui-icon.ico
22
-	echo "1 ICON \"boxui-icon.ico\"" > boxui-icon.ico
22
+	echo "1 ICON \"boxui-icon.ico\"" > boxui-icon.rc
23 23
 
24 24
 boxui-icon.o: boxui-icon.rc boxui-icon.ico
25 25
 	x86_64-w64-mingw32-windres --preprocessor /usr/bin/cpp boxui-icon.rc boxui-icon.o
... ...
@@ -30,12 +30,12 @@ boxui.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
30 30
 
31 31
 # boxui-windows.o: windows
32 32
 
33
-boxui-windows.o: boxui.c boxui.h
33
+boxui-windows.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
34 34
 	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"
35 35
 
36 36
 # boxui-html.o: html5
37 37
 
38
-boxui-html.o: boxui.c boxui.h
38
+boxui-html.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
39 39
 	sh -c ". emscripten/env.sh ; emcc -g -Wall -s USE_SDL=2 -s USE_SDL_TTF=2 boxui.c -c -o boxui-html.o"
40 40
 
41 41
 # boxui_demo_helloworld: linux
... ...
@@ -46,16 +46,22 @@ boxui_demo_helloworld: boxui.o boxui_demo_helloworld.o
46 46
 
47 47
 # boxui_demo_helloworld: windows
48 48
 
49
+boxui_demo_helloworld-windows.o: boxui_demo_helloworld.c boxui.h
50
+	sh -c ". zig/env.sh >/dev/null ; zig cc -I./zig/windows-msys2-mingw/include/ -I./zig/windows-msys2-mingw/include/SDL2 boxui_demo_helloworld.c -c -o boxui_demo_helloworld-windows.o -target x86_64-windows-gnu"
51
+
49 52
 boxui_demo_helloworld.exe: boxui-icon.o boxui-windows.o boxui_demo_helloworld-windows.o
50 53
 	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"
51 54
 
52 55
 # boxui_demo_helloworld: html5
53 56
 
54
-boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_helloworld.c
55
-	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"
57
+boxui_demo_helloworld-html.o: boxui_demo_helloworld.c
58
+	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"
59
+
60
+boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_helloworld-html.o
61
+	sh -c ". emscripten/env.sh ; emcc boxui_demo_helloworld-html.o boxui-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 && zip -pr boxui_demo_helloworld-html.zip boxui_demo_helloworld.html boxui_demo_helloworld.js boxui_demo_helloworld.wasm"
62
+
56 63
 
57 64
 clean:
58
-	rm -f *.o boxui-icon.ico boxui-icon.rc \
65
+	rm -f *.o *.js *.html *.wasm *.exe *.ico *.rc \
59 66
  notosans_regular_ttf.c notosans_regular_ttf.h \
60
- boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html
61
-
67
+ boxui_demo_helloworld boxui_demo_helloworld-html.zip
Browse code

Toolchain setup scripts and skeleton of demo Makefile

Dario Rodriguez authored on 16/06/2023 20:22:19
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,61 @@
1
+CC=gcc
2
+CFLAGS=-Wall -g -I/usr/include/SDL2
3
+LDFLAGS=-lSDL2 -lSDL2_ttf
4
+
5
+all: boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html
6
+
7
+# common
8
+
9
+notosans_regular_ttf.c: fonts/NotoSans-Regular.ttf
10
+	(cd fonts && xxd -i NotoSans-Regular.ttf | tr A-Z a-z ) > notosans_regular_ttf.c
11
+
12
+notosans_regular_ttf.h: fonts/NotoSans-Regular.ttf
13
+	(cd fonts && xxd -i NotoSans-Regular.ttf | sed "s/^\(.*[^ ]\) *=.*/extern \1\;/g" | grep extern | tr A-Z a-z ) > notosans_regular_ttf.h
14
+
15
+
16
+# windows build icon
17
+
18
+boxui-icon.ico: boxui-icon_256x256.png
19
+	convert boxui-icon_256x256.png boxui-icon.ico
20
+
21
+boxui-icon.rc: boxui-icon.ico
22
+	echo "1 ICON \"boxui-icon.ico\"" > boxui-icon.ico
23
+
24
+boxui-icon.o: boxui-icon.rc boxui-icon.ico
25
+	x86_64-w64-mingw32-windres --preprocessor /usr/bin/cpp boxui-icon.rc boxui-icon.o
26
+
27
+# boxui.o: linux
28
+
29
+boxui.o: boxui.c boxui.h notosans_regular_ttf.c notosans_regular_ttf.h
30
+
31
+# boxui-windows.o: windows
32
+
33
+boxui-windows.o: boxui.c boxui.h
34
+	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"
35
+
36
+# boxui-html.o: html5
37
+
38
+boxui-html.o: boxui.c boxui.h
39
+	sh -c ". emscripten/env.sh ; emcc -g -Wall -s USE_SDL=2 -s USE_SDL_TTF=2 boxui.c -c -o boxui-html.o"
40
+
41
+# boxui_demo_helloworld: linux
42
+
43
+boxui_demo_helloworld.o: boxui_demo_helloworld.c boxui.h
44
+
45
+boxui_demo_helloworld: boxui.o boxui_demo_helloworld.o
46
+
47
+# boxui_demo_helloworld: windows
48
+
49
+boxui_demo_helloworld.exe: boxui-icon.o boxui-windows.o boxui_demo_helloworld-windows.o
50
+	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"
51
+
52
+# boxui_demo_helloworld: html5
53
+
54
+boxui_demo_helloworld.html: boxui-html.template boxui-html.o boxui_demo_helloworld.c
55
+	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"
56
+
57
+clean:
58
+	rm -f *.o boxui-icon.ico boxui-icon.rc \
59
+ notosans_regular_ttf.c notosans_regular_ttf.h \
60
+ boxui_demo_helloworld boxui_demo_helloworld.exe boxui_demo_helloworld.html
61
+