Reputation: 1587
I am trying to install a program on my machine (running Linux), but I get the following error when I run make
:
Starting build...
Working Directory : /home/laptop/mplabs_test
Build Type :
Generating OMP binary...
/bin/sh: 1: Syntax error: "&" unexpected
make: *** [lbs3d] Error 2
What is wrong, am I missing a library?
Upvotes: 0
Views: 336
Reputation: 81022
You can control the shell that make uses for executing recipes by setting the SHELL
variable in the makefile.
If that makefile uses bash-specific features then it should be setting SHELL=/bin/bash
already. Since it appears it isn't doing that you get to do that yourself instead.
Either modify the makefile in question or use
make SHELL=/bin/bash
instead of just running make
.
Upvotes: 1
Reputation: 16354
The problem is that the Makefile uses bash specific syntax (|&
) but the commands are executed by /bin/sh
, which does not point to /bin/bash
.
On my computer (Ubuntu 14.04):
ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Sep 16 2014 /bin/sh -> dash
A solution could be to let the symbolic link /bin/sh
point to /bin/bash
:
sudo rm /bin/sh
sudo ln -s /bin/bash /bin/sh
Upvotes: 0