From 18eb4842536d1c9df278e7f65c16ce5679b99d39 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 25 Sep 2015 22:17:03 -0400 Subject: makefile replacement: step 2/2: use the midipix build template. --- sysinfo/host/host.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 sysinfo/host/host.sh (limited to 'sysinfo/host/host.sh') diff --git a/sysinfo/host/host.sh b/sysinfo/host/host.sh new file mode 100755 index 0000000..1fe2515 --- /dev/null +++ b/sysinfo/host/host.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +error_msg() +{ + echo $@ >&2 +} + +host_test() +{ + mb_hdrdir=$(pwd)/build + mkdir -p $mb_hdrdir || exit 2 + + if [ x"$mb_compiler" = x ]; then + echo "config error: compiler not set." + exit 2 + fi + + $mb_compiler -dM -E - < /dev/null > /dev/null && return 0 + + error_msg "config error: invalid compiler." + exit 2 +} + + +# one: args +for arg ; do + case "$arg" in + --help) usage + ;; + --compiler=*) + mb_compiler=${arg#*=} + ;; + --cflags=*) + mb_cflags=${arg#*=} + ;; + *) + error_msg ${arg#}: "unsupported config argument." + exit 2 + ;; + esac +done + + +# two: test +host_test + + +# all done +exit 0 -- cgit v1.2.3