Question

I do not know why I am getting these error messages from the shell or where ever they are coming from? I've simplified a make file. Here is the make file simple.mk

 # simple trial makefile
    $(warning Making where CURDIR is $(CURDIR))
    $(warning  $(shell ls -ld "$(CURDIR)" ) )
    $(shell "ls -l $(CURDIR)" )
    $(shell "\ls -l /home/me/BitHoist/run/objects" )

I run it.

me $ make -f simple.mk
simple.mk:2: Making where CURDIR is /home/me/BitHoist/source
simple.mk:3: drwxrwxr-x. 2 me me 4096 Apr 27 18:37 /home/me/BitHoist/source 
/bin/sh: ls -l /home/me/BitHoist/source: No such file or directory
/bin/sh: \ls -l /home/me/BitHoist/run/objects: No such file or directory
make: *** No targets.  Stop.
me $ 

I figured out one solution, enclose in $(warning )

I do not know why I am getting these error messages?

/bin/sh: ls -l /home/me/BitHoist/source: No such file or directory
 /bin/sh: \ls -l /home/me/BitHoist/run/objects: No such file or directory

Seems to be an error message from sh.

Robert

Was it helpful?

Solution

Running $(shell "ls -l $(CURDIR)" ) is like typing "ls -l /home/me/BitHoist/source" to the shell prompt (including quotes).

Try that and you'll see you'll get the same error you get from the makefile. Make passes those quotes along to the shell verbatim, so the shell is trying to run a program literally named ls -l /home/me/BitHoist/source, which is obviously not a real program name. Hence the error.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top