summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-01-23 11:50:29 +0100
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2024-01-23 11:50:29 +0100
commit7385ed39a40ca09e66e107b5f47a25d5b0ccbaf7 (patch)
tree1b9c3895596bb2e6f94b279d75e40d8432a49e47
parentdc9b0f067bd0b2bd5637841253e0b115c6aa8646 (diff)
downloadalex-master.tar.gz
alex-master.zip
Add check-deps target in MakefileHEADmaster
It's useful to configure the OS before building.
-rw-r--r--Makefile5
-rwxr-xr-xscripts/check-deps.sh52
2 files changed, 56 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index ddf7c36..67628ad 100644
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,10 @@ KERNEL_VERSION = 5.11.6
BUSYBOX_VERSION = 1.33.0
SYSLINUX_VERSION = 6.03
-all: busybox linux initrd
+all: check-deps busybox linux initrd
+
+check-deps:
+ scripts/check-deps.sh
initrd:
@mkdir -p $@
diff --git a/scripts/check-deps.sh b/scripts/check-deps.sh
new file mode 100755
index 0000000..7568e47
--- /dev/null
+++ b/scripts/check-deps.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+check_app()
+{
+ which $1 2>/dev/null 1>/dev/null
+ local result=$?
+
+ echo -n "Checking $1..."
+
+ if [ $result -gt 0 ]; then
+ echo 'Not found'
+ exit 1
+ else
+ echo 'Found'
+ fi
+}
+
+check_pkg()
+{
+ $pkg | grep $1 2>/dev/null 1>/dev/null
+ local result=$?
+ echo -n "Checking $1..."
+
+ if [ $result -gt 0 ]; then
+ echo 'Not found'
+ exit 1
+ else
+ echo 'Found'
+ fi
+}
+
+fedora()
+{
+ check_app gcc
+ check_app make
+ check_pkg glibc-static
+}
+
+osname=`cat /etc/os-release | grep ^ID= | sed -E 's/.*=(.*)/\1/'`
+osver=`cat /etc/os-release | grep ^VERSION_ID= | sed -E 's/.*=(.*)/\1/g'`
+
+case $osname in
+ fedora)
+ pkg="dnf list installed"
+ fedora
+ ;;
+ freebsd)
+ ;;
+esac
+
+echo
+echo 'You can proceed building Alex GNU/Linux'