Path: utzoo!utgpu!watmath!clyde!mcdchg!chinet!att!osu-cis!tut.cis.ohio-state.edu!mailrus!cornell!uw-beaver!uw-june!uw-entropy!dataio!pilchuck!ssc!happym!kent From: kent@happym.UUCP (Kent Forschmiedt) Newsgroups: comp.bugs.sys5 Subject: Make(1) bug in SVR2 Message-ID: <555@happym.UUCP> Date: 28 Oct 88 20:33:15 GMT Reply-To: kent@happym.UUCP (Kent Forschmiedt) Organization: Happy Man Corp. Lines: 48 Make did a very evil thing. I had created a circular dependency in my makefile, and was using make -d to find it. A condensed version, showing my mistake, follows. There are about 35 object files in the library that it was building. There is an odd rule for one of the objects, because part of its source is generated by another program. I had accidentally made the program dependent on the library, thus creating the circle. In the context of the example below, $(LIB)(file1.o) was not up to date realtive to s.file1.c, and $(LIB)(file2.o) was up to date. I was watching it go, using ^S/^Q to stop and start it, until I found the problem, then hit ^C (DEL, for purists) to stop it. I couldn't see what it was doing when I did that, since ^C flushes the tty output buffer. It said "*** s.file2.c removed ***" !!! And it was true! LIBOBJ = $(LIB)(file1.o) $(LIB)(file2.o) # file1.c #includes x.i $(LIB)(file1.o): file1.c funnycmd funnycmd >x.i $(CC) -c $(CFLAGS) file1.c ar rv $(LIB) file1.o rm -f file1.o funnycmd: $(LIB) .c.a: $(LINT) $(LINTFLAGS) -u -lm -Ldb -c $< $(CC) $(CFLAGS) -c $< ar rv $@ $*.o rm -f $*.o .c~.a: $(GET) $(GFLAGS) -p $< > $*.c $(LINT) $(LINTFLAGS) -u -lm -Ldb -c $*.c $(CC) -c $(CFLAGS) $*.c ar rv $@ $*.o rm -f $*.[co] -- kent@happym.UUCP, tikal!camco!happym!kent, Happy Man Corp. USA 206-282-9598