/ bin / sh, called from make, does not find a command with an invalid dash argument

I have a makefile for creating some converters using the Xerox end state tools (in this case xfst) that I call in my makefile, for example (except for the hard tab, and not spaces in the actual makefile, of course):

latin.fst: nouns.fst verbs.fst
    xfst -f build/latin.fst.build

On my laptop (Mac with OS X 10.6.2) this works fine, but on my university Linux machines I get this error:

make: xfst: Command not found
make: *** [nouns.fst] Error 127

After some debugging, I found two ways to fix this problem. The first is to specify an argument -ffor xfst:, the "-f"other is SHELL=/bin/bashat the top of the makefile.

From the second fix (and how the work works), it seems that the problem is related to the way the / bin / sh command executes the command. Now / bin / sh is associated with / bin / bash, so it is not due to some weird shell installed as / bin / sh. Also, calling / bin / sh and running commands or a call /bin/sh -c "xfst -f build/latin.fst.build"works just dandy.

Make is GNU Make 3.81, bash is GNU bash, version 3.2.25 (1) -release.

Does anyone know what is going on here?

+3
source share
3 answers

This is a strange mistake, and I don’t know what causes it, but here is what I will try:

.PHONY: experiment
experiment:
    @echo make SHELL variable: $ (SHELL)
    @echo the actual shell: $$ SHELL
    which xfst

Edit:
... , Make failed nouns.fst, latin.fst. ? ( , .)

EDIT:
, . , , , aliasing "xfst -f", xfst, ... , .

+2

, bash - (.bashrc .bash_profile), $PATH Linux, , xfst. /bin/sh .bash*, .

0

, , , , . , , Linux Unix 0x0a, DOS Windows 0x0d 0x0a, Mac 0x0d. hd filename, , ( ).

0

Source: https://habr.com/ru/post/1723366/


All Articles