bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Documentation - reference not defined query


From: Paul Smith
Subject: Re: Documentation - reference not defined query
Date: Mon, 20 Jan 2020 16:32:39 -0500
User-agent: Evolution 3.34.1-2

Please always CC the mailing list instead of email me directly (or just
reply only to the list).  That way others can help even if I'm unavailable.


On Mon, 2020-01-20 at 14:44 -0500, Pete Edwards wrote:
> Dear paul, Thank you
> You are right, I tried to print the IDF_PATH variable contents using a
> standard script command. I'd lef t that in the Makefile when I cut and
> pasted it to the last email
> 
> For your command 
> $(info IDF_PATH = $(IDF_PATH))
> When I execute it I get the value
> IDF_PATH=/home/pete/esp/esp-idf:/home/esp/esp-idf

Just as I'd suspected.  This is not a single directory, it's two different
directories separated with a ":".  Just like your normal PATH environment
variable.

This explains your problem.

> The terminal command echo $IDF_PATH
> returns 
> pete@pete:~/esp/hello_world$ echo $IDF_PATH
> /home/pete/esp/esp-idf

Well, that may be the value of the environment variable in your shell, but
clearly somehow before your makefile is invoked that value is being
changed, as you can see from the output of $(info $(IDF_PATH)) above.

We can't say how that happens of course with the information you've
provided: that's something you'll have to investigate for yourself.

> and in this directory /home/pete/esp/esp-idf/make/ there is indeed a
> "project,mk" makefile
> 
> which is used to build the project for the esp32 microprocessor...which
> works if I use the make command from the terminal window starting in
> hello-world directory

Well, that means that however you were invoking make before is causing the
value of IDF_PATH to be changed.  If you invoke make directly from here,
it's not changed.

> that Makefile is
> pete@pete:~/esp/hello_world$ more Makefile
> 
> #
> # This is a project Makefile. It is assumed the directory this Makefile
> resides in is a
> # project subdirectory.
> #
> 
> PROJECT_NAME := hello-world
> 
>     include $(IDF_PATH)/make/project.mk

I'll try to be more clear: this is wrong.

The IDF_PATH variable does not contain _A SINGLE_ directory.  It contains a
_SEQUENCE OF ONE OR MORE_ directories, separated by colons.

If that sequence happens to contain exactly one value, then this will work
by accident as you've seen.

If that sequence contains more than one value, then it won't work because
as I said before, you're trying to include a file named like this:

  include $(IDF_PATH)/make/project.mk
    -> expands to ->
  include /home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk

which is clearly wrong.  Try to run this command at your shell prompt:

  $ ls '/home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk'

and you'll see it will fail with an unknown file error because that file
doesn't exist.

Basically, you cannot use the value of the IDF_PATH variable here.  That
variable is not appropriate.  You will either have to find some other
variable that contains the path you want, or you'll have to manipulate this
variable to break it down into its component directories so you can use
them.  You haven't provided enough details for us to suggest the best way
to do that.

> When make Makefile is executed at a terminal window from within the
> directory I now get the error 
>  
> pete@pete:~/esp/esp-idf/examples/get-started/hello_world$ make Makefile
> /home/pete/esp/esp-idf/make/project.mk:7: *** missing separator.  Stop.

"missing separator" is make's way of saying "syntax error".

It means that whatever text is at line 7 of the project.mk file, it is not
valid makefile syntax.

Since you've not shown us what that line is, there's little we can suggest
about it: you need to look at that line and fix whatever is wrong with it.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]