Makefile whitespace... a neophyte question.

Martin Serrer SERRER at ODIN.NRC.CA
Wed May 15 01:03:00 AEST 1991


Hello Makefile experts...

  Please excuse the dumb question but this is driving me crazy...
Given the following specification in a Makefile:

wave: wave.o wagen.o
        ${CC} ${LDFLAGS} ${OBJS} -o $@ ${LIBS}

  If the whitespace before the ${CC} is a <tab>, everything is fine. But try
using <spaces> and the following 'helpful' error appears...

Make: file `Makefile' line 11: must be a separator (: or ::) for rules.  Stop.

  Could someone explain this. I do a lot of cutting and pasting between windows
and <tabs> automagically become <spaces> in the destination window so I run into
this problem frequently. I've RTFM and yes it mumbles something about 'commands
may appear on lines beginning with a tab immediately following a dependency
line' etc.
  Was this an unfortunate choice of syntax back in pre-history and is cast in
stone or can something be done about it. I always thought that 'white space is
white space is white space'

+-----------------------------------------------------------------------------+
| Martin Serrer                           Bldg.M32,  Montreal Rd.             |
| 613-993-9442                            National Research Council of Canada,|
| Martin.Serrer at nrc.ca                    Ottawa,  Ontario,  Canada  K1A-0R6  |
+------------------- Software Rusts, Rust never Sleeps -----------------------+



More information about the Comp.sys.sgi mailing list