Subject: make problem: multiple taget patterns
From: [email-masked] (Yung Hsien)

1 Jul 1997 19:47:14 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.01Gold (WinNT; I)
Original-To: [email-masked]
Original-Sender: [email-masked]

Hello all,

I'm having a problem with the GNU make from b18...

My makefiles use gcc to build .d files and then include them into the
make. I also use pattern matching to build the object files.

Here's a cut from the makefiles:

%.o:	%.c
	$(GREPSTRING)
	$(CC) $(CFLAGS) $(INC) -c $< -o $@

%.o:	%.s
	$(GREPSTRING)
	$(CC) $(CFLAGS) $(INC) -c $< -o $@

%.o:	%.cxx
	$(CC) $(CFLAGS) $(INC) -c $< -o $@

%.d:	%.cxx
	(trap 'rm $@' 2; $(ECHO) "$@ " | tr -d '\012' > $@ ; \
	$(DCC) $(CFLAGS) $(INC) -M -DDEPCHK $< >> $@ || rm $@ )

%.d:	%.c
	(trap 'rm $@' 2; $(ECHO) "$@ " | tr -d '\012' > $@ ; \
	$(DCC) $(CFLAGS) $(INC) -M -DDEPCHK $< >> $@ || rm $@ )

include $(OBJS:.o=.d)

So my .d files end up looking something like this:

hdrgen.d hdrgen.o: hdrgen.c hdrgen.h (more random header files)

Now when I run make, it complains about the multiple header files (I
think)

hdrgen.d:1: *** multiple target patterns.  Stop.
gmake: *** [apps] Error 2
gmake: *** [all] Error 2
gmake: *** [tools] Error 2

Compilation exited abnormally with code 2 at Tue Jul 01 16:09:06

I've manually edited my .d file to this

hdrgen.o: hdrgen.c

which works, but as soon as I add a header file dependency, it fails

hdrgen.o: hdrgen.c hdrgen.h

BTW, this all works fine with make v3.70 on UNIX
Anybody of any insights?

Thanks,
Yung Hsien
[email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".