A make question
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > A make question




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    A make question  
Daniel Haude


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-23-04 01:34 PM

Hello,

Why is make complaining about a "circular dependency" in this makefile?

----
dh@kir:~/c/foo$ cat Makefile
lexer.yy.c : lexer.yy
flex --header-file=lexer.yy.h -o $@ $<
dh@kir:~/c/foo$ make
make: Circular lexer.yy <- lexer.yy.c dependency dropped.
dh@kir:~/c/foo$
----

Strangely, the error disappears when I call the target something else than
lexer.yy.c

What's the cause of this?

Thsnks,
**Daniel

--
"With me is nothing wrong! And with you?" (from r.a.m.p)





[ Post a follow-up to this message ]



    Re: A make question  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-23-04 01:34 PM

In article <slrnc8i0mb.7dd.haude@kir.physnet.uni-hamburg.de>,
Daniel Haude <haude@physnet.uni-hamburg.de> wrote:

> Hello,
>
> Why is make complaining about a "circular dependency" in this makefile?
>
> ----
> dh@kir:~/c/foo$ cat Makefile
> lexer.yy.c : lexer.yy
>         flex --header-file=lexer.yy.h -o $@ $<
> dh@kir:~/c/foo$ make
> make: Circular lexer.yy <- lexer.yy.c dependency dropped.
> dh@kir:~/c/foo$
> ----
>
> Strangely, the error disappears when I call the target something else than
> lexer.yy.c
>
> What's the cause of this?

Make has built-in dependencies for:

*: *.o
*.o: *.c

which creates an indirect dependency for * <- *.c.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: A make question  
Lorinczy Zsigmond / Domonyik Mariann


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-24-04 06:34 AM

Daniel Haude wrote:

> Hello,
>
> Why is make complaining about a "circular dependency" in this makefile?
>
> ----
> dh@kir:~/c/foo$ cat Makefile
> lexer.yy.c : lexer.yy
>         flex --header-file=lexer.yy.h -o $@ $<
> dh@kir:~/c/foo$ make
> make: Circular lexer.yy <- lexer.yy.c dependency dropped.
> dh@kir:~/c/foo$
> ----
>
> Strangely, the error disappears when I call the target something else than
> lexer.yy.c
>
> What's the cause of this?

You should use the standard file-extensions, like lexer.y, lexer.c, lexer.h





[ Post a follow-up to this message ]



    Re: A make question  
Daniel Haude


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-26-04 09:34 AM

On Fri, 23 Apr 2004 08:24:11 -0400,
Barry Margolin <barmar@alum.mit.edu> wrote
in Msg. <barmar-126C97.08241123042004@comcast.ash.giganews.com>
> Make has built-in dependencies for:
>
> *: *.o
> *.o: *.c
>
> which creates an indirect dependency for * <- *.c.

..which means that make would like to create lexer.yy from lexer.yy.c (via
lexer.yy.o) instead of lexer.yy.c from lexer.yy? I guess that makes
sense. Renaming the files appropriately took care of it. Thanks for the
help (and note my flex question elsewhere on this group ;-)

--Daniel

--
"With me is nothing wrong! And with you?" (from r.a.m.p)





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:52 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register