Documentation - reference not defined query

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Documentation - reference not defined query

Pete Edwards
Hi,

I am new to make and Makefiles and ran into a problem through eclipse, which I am researching the cause for...not getting there fast I know.
Anyway, I decided to research make today and get confused with references to some things in your documentation, Soo Since I read your bug reporting page, maybe you'd like to point me in the right direction.

The reference to RCS and SCCS file types on page 

What is an RCS File type?  Google references 3D scene data type...I don't think that's where we are.
SCCS file type? Nothing found for that type..
No definition for SCCS or RCS file typs there either...
Could you enlighten me on the file types and what generates them please?

Oh and the  research I am trying to resolve
The make output is: 
======================
 12:46:45 **** Build of configuration Default for project hello_world ****
make -j4 all
Makefile:8: /home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk: No such file or directory
make: *** No rule to make target '/home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk'.  Stop.
"make -j4 all" terminated with exit code 2. Build might be incomplete.
===================

I see that make thinks Makefile include file exists in /home/pete/esp/esp-idf/ which it does, but the next part of the line (and where that is data gets set) eludes me.

"/home/esp/esp-idf/make/project.mk: No such file or directory" 
This project.mk file is not in this directory, it is in directory 
/home/pete/esp/esp-idf/make/project.mk
$HOME is defined as /home/pete

IDF_PATH = "/home/pete/esp/esp-idf" and is defined to the compiler directives under eclipse.
and defined in the Makefile
"Makefile"
#
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
# project subdirectory.
#

PROJECT_NAME := hello-world
echo $(IDF_PATH);
include $(IDF_PATH)/make/project.mk
=====================end of makefile============

how does make build the line with the colon in it like so?

/home/pete/esp/esp-idf  :   /home/esp/esp-idf/make/project.mk
(spaces added for reading clarity)
when I have not defined the 2nd string and it is not the true location of the esp-idf/make/project.mk file, which is in /home/pete/esp/esp-idf/project.mk? (The /pete/ directory is missing. Is the string built from a script that is using /home/ as the default home directory by any chance?

I spent 7 days looking at this now! (Learned a lot, I also learned I need some help)

Please advise?

Thanks

Pete E


Reply | Threaded
Open this post in threaded view
|

RCS / SCCS (was: Re: Documentation - reference not defined query)

Paul Smith-20
On Mon, 2020-01-20 at 13:09 -0500, Pete Edwards wrote:

> The reference to RCS and SCCS file types on page
> https://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html#Remaking-Makefiles
>
> What is an RCS File type?  Google references 3D scene data type...I don't
> think that's where we are.
> SCCS file type? Nothing found for that type..
> I checked the Index at
> https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#index-s_002e-_0028SCCS-file-prefix_0029
> No definition for SCCS or RCS file typs there either...
> Could you enlighten me on the file types and what generates them please?

RCS: https://www.gnu.org/software/rcs/
SCCS: https://en.wikipedia.org/wiki/Source_Code_Control_System



Reply | Threaded
Open this post in threaded view
|

Re: Documentation - reference not defined query

Paul Smith-20
In reply to this post by Pete Edwards
In general it's helpful if you use plain text emails, and/or format your
email carefully especially with makefiles as things like indentation are
crucial to see correctly.

Also it's important to ask clear questions, one at a time, and give a very
clear description of your environment etc.

As a note, we don't know anything about Eclipse (at least I don't) so you
should endeavour to get your makefile working properly from the command
line.  Once that's working, if you can't invoke it from Eclipse you can ask
about that on the Eclipse mailing lists or help forums.

On Mon, 2020-01-20 at 13:09 -0500, Pete Edwards wrote:
> The make output is:
> ======================
>  12:46:45 **** Build of configuration Default for project hello_world
> ****
> make -j4 all
> Makefile:8: /home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk: No
> such file or directory

This means make is trying to include the file named, literally,  
/make/project.mk and that file (not surprisingly) cannot be found.

> "Makefile"
> #
> # This is a project Makefile. It is assumed the directory this Makefile
> resides in is a
> # project subdirectory.
> #
>
> PROJECT_NAME := hello-world
> echo $(IDF_PATH);
> include $(IDF_PATH)/make/project.mk

I don't think this can be the real makefile you're using, because "echo
$(IDF_PATH);" is not a valid make command and this line will result in a
syntax error.

If you want to show the value of a variable you must use make functions to
do it, not shell commands like "echo".  A makefile may _contain_ shell
commands (in recipes) but a makefile is not a shell script.  Instead you
can use the $(info ...) function like so:

  $(info IDF_PATH = $(IDF_PATH))

Given the error you get, I'm assuming that the IDF_PATH variable contains a
path string: that is, directories separated with ":" characters.  It
probably has this value:

  /home/pete/esp/esp-idf:/home/esp/esp-idf

Then when make evaluates this line:

  include $(IDF_PATH)/make/project.mk

that expands to the value:

  include /home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk

Obviously that's not a valid filename so the include operation fails.


Reply | Threaded
Open this post in threaded view
|

Re: Documentation - reference not defined query

Paul Smith-20
On Mon, 2020-01-20 at 13:58 -0500, Paul Smith wrote:
> > Makefile:8: /home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk:
> > No such file or directory
>
> This means make is trying to include the file named, literally,  
> /make/project.mk and that file (not surprisingly) cannot be found.

Sorry my reply got messed up here.  I meant to say it's trying to include
the file named, literally,
/home/pete/esp/esp-idf:/home/esp/esp-idf/make/project.mk


Reply | Threaded
Open this post in threaded view
|

Re: RCS / SCCS (was: Re: Documentation - reference not defined query)

Pete Edwards
In reply to this post by Paul Smith-20
Thank you Paul...makes sense now you point it out.
Thank you

Pete E


On Mon, Jan 20, 2020 at 1:44 PM Paul Smith <[hidden email]> wrote:
On Mon, 2020-01-20 at 13:09 -0500, Pete Edwards wrote:
> The reference to RCS and SCCS file types on page
> https://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html#Remaking-Makefiles
>
> What is an RCS File type?  Google references 3D scene data type...I don't
> think that's where we are.
> SCCS file type? Nothing found for that type..
> I checked the Index at
> https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html#index-s_002e-_0028SCCS-file-prefix_0029
> No definition for SCCS or RCS file typs there either...
> Could you enlighten me on the file types and what generates them please?

RCS: https://www.gnu.org/software/rcs/
SCCS: https://en.wikipedia.org/wiki/Source_Code_Control_System


Reply | Threaded
Open this post in threaded view
|

Re: Documentation - reference not defined query

Paul Smith-20
In reply to this post by Paul Smith-20
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 | Threaded
Open this post in threaded view
|

Re: Documentation - reference not defined query

Paul Smith-20
On Mon, 2020-01-20 at 16:32 -0500, Paul Smith wrote:
> > ...$ make Makefile

I also wanted to say, this is wrong as written here... you don't want to
give Makefile as a target to be built.

You should just run "make" with no arguments.  Make will read a file named
"Makefile" by default.  Only if your makefile is named something non-
standard do you need to put it on the command line, and then you must use
the "-f" option:

  make -f mymakefile

See https://www.gnu.org/software/make/manual/html_node/Makefile-Names.html