Welcome to little lamb

Code » comain » commit 6185f70

blddeps: Can use custom per-dep make script

author Olivier Brunel
2023-07-18 08:09:30 UTC
committer Olivier Brunel
2023-07-18 08:44:59 UTC
parent 0f8757b3d5552651efb744873b21693ade4e14dd

blddeps: Can use custom per-dep make script

blddeps +12 -4
meta/deps.tpl/skalibs/make +7 -0

diff --git a/blddeps b/blddeps
index df0e2c5..f3d6034 100755
--- a/blddeps
+++ b/blddeps
@@ -30,7 +30,7 @@ getdep()
     local library=$depname
     test -e "$dep/library" && library="$(cat "$dep/library")"
     if ! test -e "deps/$depname"; then return; fi
-    echo $depname lib$library $(cat "$dep/configure" 2>/dev/null)
+    echo $depname lib$library $dep
 
     # recursive lila dependency
     if ! test -d "deps/$depname/meta/deps"; then return; fi
@@ -67,15 +67,23 @@ for arg ; do
 done
 
 if test $build -eq 1; then
-    foreach deps $nb_deps getdep | tac | while read -r name library arg; do
+    foreach deps $nb_deps getdep | tac | while read -r name library dep; do
         if test -e "deps/$name/$library.a" || test -e "deps/$name/$library.so"; then
             echo :: $name already built.
             continue
         fi
         echo :: Building $name
+
+        args="$(cat "$dep/configure" 2>/dev/null)"
+        if test -e "$dep/make"; then
+            make="$(realpath "$dep/make")"
+        else
+            make=make
+        fi
+
         mbrun cd deps/$name
-        mbrun ./configure $arg
-        if test $? -eq 0; then mbrun make; fi
+        mbrun ./configure $args
+        if test $? -eq 0; then mbrun $make; fi
         mbrun cd ../..
     done
 fi
diff --git a/meta/deps.tpl/skalibs/make b/meta/deps.tpl/skalibs/make
new file mode 100755
index 0000000..daafcc9
--- /dev/null
+++ b/meta/deps.tpl/skalibs/make
@@ -0,0 +1,7 @@
+#!/bin/sh
+if test -e libskarnet.so; then rm libskarnet.so; fi
+if test -e libskarnet.a; then rm libskarnet.a; fi
+if make; then
+    if test -e libskarnet.so.xyzzy; then ln -s libskarnet.so.xyzzy libskarnet.so; fi
+    if test -e libskarnet.a.xyzzy; then ln -s libskarnet.a.xyzzy libskarnet.a; fi
+fi