delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/01/19:47:14

From: yung AT connectinc DOT com (Yung Hsien)
Subject: make problem: multiple taget patterns
1 Jul 1997 19:47:14 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <33B9952F.6F20.cygnus.gnu-win32@connectinc.com>
Reply-To: yung AT connectinc DOT com
Mime-Version: 1.0
X-Mailer: Mozilla 3.01Gold (WinNT; I)
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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
yung AT connectinc DOT com
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019