bug-make
[Top][All Lists]
Advanced

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

Re: lex implicit rule chain is broken


From: Philip Guenther
Subject: Re: lex implicit rule chain is broken
Date: Sat, 18 May 2019 22:11:42 -0900

On Sat, May 18, 2019 at 9:07 PM Mohamed Akram <address@hidden> wrote:
echo "lang: lang.l" > Makefile

This Makefile is incorrect, as it tells make that 'lang.l' is a *direct* dependency of lang.  That's not true: lang.l has to be run through lex to get a .c file that can compiled to get lang.  

 
It tries to link the .l file.

make doesn't need any special instructions to tell it how to generate an executable from a .l file, but it'll do the Wrong Thing if you tell it the wrong thing.  To achieve your apparent goal you can simply run it with *no* Makefile and give it the name of the matching executable (ala "make lang" in this case) or use a Makefile sets the default target ala
   echo ".DEFAULT_GOAL = lang" >Makefile
and it'll deduce the rest from its default pattern rules.


Philip Guenther


reply via email to

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