Browse Source

add a minimal setup check to Makefile, also print a notice to users running the developer makefile on other than Linux platforms

pull/1/head
Sami Vaarala 11 years ago
parent
commit
0a92e0b1fd
  1. 6
      Makefile
  2. 28
      util/check_setup.sh

6
Makefile

@ -170,7 +170,11 @@ CCLIBS += -lncurses # on some systems -lreadline also requires -lncurses (e.g.
# Compile 'duk' only by default
.PHONY: all
all: duk
all: checksetup duk
.PHONY: checksetup
checksetup:
@util/check_setup.sh
.PHONY: clean
clean:

28
util/check_setup.sh

@ -0,0 +1,28 @@
#!/bin/sh
#
# Check prerequisites for using the Duktape makefile. Exit with an error
# and a useful error message for missing prerequisites.
#
NODE_VERSION=`node -v 2>/dev/null`
if [ "x$NODE_VERSION" = "x" ]; then
echo "*** Missing NodeJS:"
echo " $ sudo apt-get install nodejs npm"
exit 1
fi
GIT_VERSION=`git --version`
if [ "x$GIT_VERSION" = "x" ]; then
echo "*** Missing git:"
echo " $ sudo apt-get install git"
exit 1
fi
uname -a | grep -ni linux >/dev/null
RET=$?
if [ "x$RET" != "x0" ]; then
echo "*** Based on uname, you're not running on Linux. Duktape developer"
echo " makefile is intended for Linux only; YMMV on other platforms."
echo ""
sleep 1
fi
Loading…
Cancel
Save