Hi Magnus,

On Thu, Mar 21, 2013 at 2:25 PM, Magnus Fromreide <[email protected]>
wrote:
>
> I have a makefile that contains nothing but a .PHONY target as follows:
>
> .PHONY: a
>
> If I try to build a target named 'b' then make tells me there are no rules
> for that.
>
> If I try to build a target named 'a' then make tells me that there is no
> need to remake that target.
>
> Is this implicit rule creation an intentional feature of make or just a
bug?

Well, if you created your typical hell-world.c file:

#include <stdio.h>
int main( int argc, char **argv )
{
    printf( "Hello World\n" );
    return 0;
}

and then create an empty Makefile, (perhaps using touch Makefile), then

820 >make hello-world
cc     hello-world.c   -o hello-world

It compiles and builds the executable. This is because make has a bunch of
builtin rules. Running "make -p" will print the builtin rules.

So, in that context, your example makefile seems perfectly sane.

--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to