On Sat, May 18, 2019 at 9:07 PM Mohamed Akram <mohd.ak...@outlook.com> 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
_______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make