Solved make doesn't recognize Makefile on FreeBSD 11

wrkilu

Member

Reaction score: 2
Messages: 20

Hi,
After migrate some Makefile from FreeBSD6 to new one (FreeBSD11) make file doesn't work. Maybe this is caused by something else ? I don't know. Currently I have even such basic Makefile:
Code:
first:
        @bin/generator.pl
and after make command I get:
Code:
make: exec(bin/generator.pl) failed (No such file or directory)
*** Error code 1

Stop.
make: stopped in /etc/generator

Of course paths and folders are correct. Could somebody help me with that issue ? Thanks
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 14,079
Messages: 40,790

Does the first line (the 'shebang') of the Perl script refer to /usr/bin/perl perhaps? Perl used to have a symlink there that has since been removed, it's now /usr/local/bin/perl. If a script can't find the interpreter from the shebang line you get the rather cryptic "no such file or directory" error.
 
OP
W

wrkilu

Member

Reaction score: 2
Messages: 20

You're right. I fixed symlink and now all works.
Thanks Admin ;)
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 14,079
Messages: 40,790

Symlink shouldn't be there, you need to fix the script.

Code:
> pkg info -D perl5\*
perl5-5.24.2:
Always:
The /usr/bin/perl symlink has been removed starting with Perl 5.20.
For shebangs, you should either use:

#!/usr/local/bin/perl

or

#!/usr/bin/env perl

The first one will only work if you have a /usr/local/bin/perl,
the second will work as long as perl is in PATH.
 
Top