Last active
August 29, 2015 13:57
-
-
Save hiyuh/9639531 to your computer and use it in GitHub Desktop.
my lazy wrapper script for nvc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
guess_prefix() { | |
if [ -x ./src/nvc ] ; | |
then | |
# NOTE: in-tree build, on top build = srouce directly. | |
echo "." ; | |
else | |
if [ -x ../src/nvc ] ; | |
then | |
# NOTE: inside-tree build, on top of build directory. | |
echo ".." ; | |
else | |
if [ -x ../nvc/src/nvc ] ; | |
then | |
# NOTE: outside-tree build, on top of build directory. | |
echo "../nvc" ; | |
else | |
# FIXME: improve more prefix guessing? | |
echo "NotFound " ; | |
fi ; | |
fi ; | |
fi ; | |
} | |
eeval() { | |
echo "# $*" ; | |
eval $* ; | |
} | |
prefix=$(guess_prefix) ; | |
if test x${prefix} != xNotFound ; | |
then | |
lib=${prefix}/lib/std:${prefix}/lib/ieee:${prefix}/lib/nvc ; | |
imp=${prefix}/src ; | |
exe=${prefix}/src/nvc ; | |
eeval NVC_LIBPATH=${lib} NVC_CYG_LIB=${imp} ${exe} $* ; | |
else | |
echo "# prefix not found" ; | |
fi ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment