bug-make
[Top][All Lists]
Advanced

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

.c.o inference rule POSIX conformance


From: G.P. Halkes
Subject: .c.o inference rule POSIX conformance
Date: Sat, 4 Feb 2006 11:40:58 +0100

Hello,

I was trying to make a Makefile which would work on all POSIX compliant
make implementations, when I noticed a difference in behaviour between
GNU make and other make implementations. The difference is in the .c.o
inference rule.

So I checked the POSIX specifications. The POSIX standard (or at least
the 2004 version) specifies that the rule for .c.o: should be

$(CC) $(CFLAGS) -c $<

The default GNU make rule is (obtained through the -p option)

$(COMPILE.c) $(OUTPUT_OPTION) $<

Note the $(OUTPUT_OPTION) which gets set to -o address@hidden This is fine (and
most probably what you want). But when the .POSIX: target is included as
the first non-comment line of the Makefile, the POSIX standard
specifies that a standards compliant implementation should not have any
non-compatible extensions. However, even when I include .POSIX: as the
first line of my Makefile, the inference rule is unchanged and still
includes the output option.

From my reading of the standard I conclude that this is a minor POSIX
compliance bug.

I checked both versions 3.80 and the current CVS version, and both have
the same behaviour.

I hope this report is helpful.

Regards,
G. Halkes





reply via email to

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