Browse code

Change toolchain directories and setup-scripts names.

Dario Rodriguez authored on 01/07/2023 15:15:29
Showing 6 changed files
... ...
@@ -1,7 +1,9 @@
1 1
 *.reu
2
-zig
3
-zig-dl
4
-emscripten
2
+toolchain-zig
3
+toolchain-zig-dl
4
+toolchain-emscripten
5
+toolchain-android
6
+toolchain-android-dl
5 7
 *.html
6 8
 *.js
7 9
 *.wasm
... ...
@@ -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 \
66 65
deleted file mode 100755
... ...
@@ -1,24 +0,0 @@
1
-#!/bin/bash
2
-if [ -e emscripten ] ; then
3
-        echo "ERROR: An emscripten directory already exists, aborting install"
4
-        echo "NOTE: To upgrade the installation, use ./emscripten-upgrade.sh"
5
-        exit 1
6
-fi
7
-parentdir=$(pwd)
8
-mkdir -p emscripten
9
-cd emscripten
10
-git clone https://github.com/emscripten-core/emsdk.git
11
-cat > env.sh  <<'EOF'
12
-#!/bin/bash
13
-echo "Reminder: this script has to be used with source (.) instead of exec"
14
-EOF
15
-echo "export PATH=$parentdir/emscripten/emsdk:$parentdir/emscripten/emsdk/upstream/emscripten:\$PATH" >> env.sh
16
-echo "export EMSDK=$parentdir/emscripten/emsdk" >> env.sh
17
-chmod 755 env.sh
18
-cd ..
19
-./emscripten-update.sh
20
-echo ""
21
-echo "Installation complete."
22
-echo "To use the emscripten toolchain, first include env.sh with \". emscripten/env.sh\""
23
-
24
-
25 0
new file mode 100755
... ...
@@ -0,0 +1,24 @@
1
+#!/bin/bash
2
+if [ -e toolchain-emscripten ] ; then
3
+        echo "ERROR: A toolchain-emscripten directory already exists, aborting install"
4
+        echo "NOTE: To upgrade the installation, use ./update-toolchain-emscripten.sh"
5
+        exit 1
6
+fi
7
+parentdir=$(pwd)
8
+mkdir -p toolchain-emscripten
9
+cd toolchain-emscripten
10
+git clone https://github.com/emscripten-core/emsdk.git
11
+cat > env.sh  <<'EOF'
12
+#!/bin/bash
13
+echo "Reminder: this script has to be used with source (.) instead of exec"
14
+EOF
15
+echo "export PATH=$parentdir/toolchain-emscripten/emsdk:$parentdir/toolchain-emscripten/emsdk/upstream/emscripten:\$PATH" >> env.sh
16
+echo "export EMSDK=$parentdir/toolchain-emscripten/emsdk" >> env.sh
17
+chmod 755 env.sh
18
+cd ..
19
+./update-toolchain-emscripten.sh
20
+echo ""
21
+echo "Installation complete."
22
+echo "To use the emscripten toolchain, first include env.sh with \". toolchain-emscripten/env.sh\""
23
+
24
+
0 25
similarity index 82%
1 26
rename from zig-setup.sh
2 27
rename to setup-toolchain-zig.sh
... ...
@@ -1,25 +1,25 @@
1 1
 #!/bin/bash
2 2
 zigbuild=zig-linux-x86_64-0.11.0-dev.514+4be1bb4aa.tar.xz
3 3
 zigversion=$(echo $zigbuild | cut -d '-' -f 4)
4
-if [ -e zig ] ; then
5
-        echo "ERROR: A zig directory already exists, aborting install"
4
+if [ -e toolchain-zig ] ; then
5
+        echo "ERROR: A toolchain-zig directory already exists, aborting install"
6 6
         exit 1
7 7
 fi
8 8
 parentdir=$(pwd)
9
-mkdir -p zig zig-dl
10
-cd zig
9
+mkdir -p toolchain-zig toolchain-zig-dl
10
+cd toolchain-zig
11 11
 
12 12
 # Zig install
13
-if [ ! -e ../zig-dl/$zigbuild ] ; then
14
-        (cd ../zig-dl && wget https://ziglang.org/builds/$zigbuild)
13
+if [ ! -e ../toolchain-zig-dl/$zigbuild ] ; then
14
+        (cd ../toolchain-zig-dl && wget https://ziglang.org/builds/$zigbuild)
15 15
 fi
16
-xz -dc <../zig-dl/$zigbuild | tar -xvf -
16
+xz -dc <../toolchain-zig-dl/$zigbuild | tar -xvf -
17 17
 ln -s ${zigbuild/.tar.xz/} zig-$zigversion
18 18
 cat > env.sh  <<'EOF'
19 19
 #!/bin/bash
20 20
 echo "Reminder: this script has to be used with source (.) instead of exec"
21 21
 EOF
22
-echo "export PATH=\$PATH:$parentdir/zig/zig-$zigversion" >> env.sh
22
+echo "export PATH=\$PATH:$parentdir/toolchain-zig/zig-$zigversion" >> env.sh
23 23
 chmod 755 env.sh
24 24
 # msys2 install
25 25
 mkdir -p windows-msys2-mingw
... ...
@@ -95,16 +95,16 @@ https://mirror.msys2.org/msys/x86_64/msys2-w32api-headers-10.0.0.r16.g49a56d453-
95 95
 https://mirror.msys2.org/msys/x86_64/msys2-w32api-runtime-10.0.0.r16.g49a56d453-1-x86_64.pkg.tar.zst
96 96
 EOF
97 97
 for i in  $(cat deps.txt) ; do
98
-        if [ ! -e ../zig-dl/$(basename $i) ] ; then
99
-                (cd ../zig-dl && wget $i )
98
+        if [ ! -e ../toolchain-zig-dl/$(basename $i) ] ; then
99
+                (cd ../toolchain-zig-dl && wget $i )
100 100
         fi
101 101
 done
102
-for i in $(cd ../zig-dl && find . -maxdepth 1 -name "*.zst") ; do 
103
-         ( mkdir -p t ; cd t ; cat ../../zig-dl/$i | zstd -dc | tar -xvf - ; find . -maxdepth 1 -type d  -print | grep -v "^\.\$" | while read l ; do
104
-          (cd $l && tar -cf - . | (cd $parentdir/zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t ; done
105
-for i in $(cd ../zig-dl && find . -maxdepth 1 -name "*.xz") ; do 
106
-         ( mkdir -p t ; cd t ; cat ../../zig-dl/$i | xz -dc | tar -xvf - ; find . -maxdepth 1 -type d  -print | grep -v "^\.\$" | while read l ; do
107
-         (cd $l && tar -cf - . | (cd $parentdir/zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t ; done
102
+for i in $(cd ../toolchain-zig-dl && find . -maxdepth 1 -name "*.zst") ; do 
103
+         ( mkdir -p t ; cd t ; cat ../../toolchain-zig-dl/$i | zstd -dc | tar -xvf - ; find . -maxdepth 1 -type d  -print | grep -v "^\.\$" | while read l ; do
104
+          (cd $l && tar -cf - . | (cd $parentdir/toolchain-zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t ; done
105
+for i in $(cd ../toolchain-zig-dl && find . -maxdepth 1 -name "*.xz") ; do 
106
+         ( mkdir -p t ; cd t ; cat ../../toolchain-zig-dl/$i | xz -dc | tar -xvf - ; find . -maxdepth 1 -type d  -print | grep -v "^\.\$" | while read l ; do
107
+         (cd $l && tar -cf - . | (cd $parentdir/toolchain-zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t ; done
108 108
 cat > add-zst.sh <<'EOF'
109 109
 #!/bin/bash
110 110
 if [ "m$1" == "m" ] || [ "m$1" == "m--help" ] || [ ! -f "$1" ] ; then
... ...
@@ -114,7 +114,7 @@ fi
114 114
 i="$1"
115 115
 ( mkdir -p t ; cd t ; cat ../$i | zstd -dc | tar -xvf - ; find . -maxdepth 1 -type d  -print | grep -v "^\.\$" | while read l ; do
116 116
 EOF
117
-echo " (cd \$l && tar -cf - . | (cd $parentdir/zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t " >> add-zst.sh
117
+echo " (cd \$l && tar -cf - . | (cd $parentdir/toolchain-zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t " >> add-zst.sh
118 118
 cat > add-xz.sh <<'EOF'
119 119
 #!/bin/bash
120 120
 if [ "m$1" == "m" ] || [ "m$1" == "m--help" ] || [ ! -f "$1" ] ; then
... ...
@@ -124,7 +124,7 @@ fi
124 124
 i="$1"
125 125
 ( mkdir -p t ; cd t ; cat ../$i | xz -dc | tar -xvf - ; find . -maxdepth 1 -type d  -print | grep -v "^\.\$" | while read l ; do
126 126
 EOF
127
-echo " (cd $l && tar -cf - . | (cd $parentdir/zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t " >> add-xz.sh
127
+echo " (cd $l && tar -cf - . | (cd $parentdir/toolchain-zig/windows-msys2-mingw && tar -xvf - ) ) ; done ) ; rm -rf t " >> add-xz.sh
128 128
 chmod a+x add-xz.sh add-zst.sh
129 129
 # Check for windres
130 130
 if ! which x86_64-w64-mingw32-windres >/dev/null 2>/dev/null; then
... ...
@@ -138,4 +138,4 @@ fi
138 138
 
139 139
 echo ""
140 140
 echo "Installation complete."
141
-echo "To use the zig toolchain, first include env.sh with \". zig/env.sh\""
141
+echo "To use the zig toolchain, first include env.sh with \". toolchain-zig/env.sh\""
142 142
similarity index 69%
143 143
rename from emscripten-update.sh
144 144
rename to update-toolchain-emscripten.sh
... ...
@@ -1,5 +1,5 @@
1 1
 #!/bin/bash
2
-cd emscripten/emsdk
2
+cd toolchain-emscripten/emsdk
3 3
 git pull
4 4
 ./emsdk install latest
5 5
 ./emsdk activate latest