[gnu.utils.bug] Implicit rules in GNU Make

weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) (01/25/89)

The documentation for GNU make (3.27) says that

          x: y.o z.o

     when `x.c', `y.c' and `z.c' all exist will execute:

          cc -c x.c -o x.o
          cc -c y.c -o y.o
          cc -c z.c -o z.o
          cc x.o y.o z.o -o x
          rm -f x.o
          rm -f y.o
          rm -f z.o

On this machine (Alliant FX/8), the compiler complains:

    cc: -o would overwrite x.o

Shouldn't the "-o x.o" be omitted if the -c flag is present?

ajudge@maths.tcd.ie (Alan Judge) (01/27/89)

In article <8901242004.AA06732@Gang-of-Four.Stanford.EDU>
	weening@GANG-OF-FOUR.STANFORD.EDU (Joe Weening) writes:
...
>    cc: -o would overwrite x.o
>
>Shouldn't the "-o x.o" be omitted if the -c flag is present?

Some compilers will allow the -o flag with the -c flag. It allows more
control over where the output goes.

However, if you look in the Makefile for GNU Make 3.27 you will find a
comment that says to add "-DNO_MINUS_C_MINUS_O" to the CFLAGS when
building GNU Make if your compiler does not support -c and -o
together.
--
Alan Judge, Dept. of Maths., Trinity College Dublin, Ireland.
Smart: ajudge@maths.tcd.ie	Stupid: ...!uunet!maths.tcd.ie!ajudge