help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Makefile not correctly rebuilding project


From: Alex Buell
Subject: Re: Makefile not correctly rebuilding project
Date: Mon, 07 Jun 2010 15:48:34 +0100

On Mon, 2010-06-07 at 12:06 +0000, Greg Chicares wrote:
> On 2010-06-07 10:52Z, Alex Buell wrote:
> > 
> > $ more assembler/vasm.d
> > vasm.o: assembler/vasm.c /usr/include/stdio.h /usr/include/features.h \
> 
> Could that file have been generated by something other than the following?
> 
> > %.d: %.c
> >     $(CC) -M $(CFLAGS) $< > address@hidden; \
> >     $(SED) 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < address@hidden > $@; \
> >     rm -f address@hidden
> 
> Wouldn't the sed command produce
>   vasm.o vasm.d : assembler/vasm.c /usr/include/stdio.h 
> /usr/include/features.h \
> with two filenames before the colon, instead of
>   vasm.o: assembler/vasm.c /usr/include/stdio.h /usr/include/features.h \
> ?
> 
> And do you really want
>   assembler/vasm.o assembler/vasm.d : assembler/vasm.c [...]
> instead?

Hmm. I just did this:

$ gcc -M -ggdb3 assembler/vasm.c 
vasm.o: assembler/vasm.c /usr/include/stdio.h /usr/include/features.h \
 /usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
 /usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h \
 /usr/lib/gcc/i686-pc-linux-gnu/4.4.3/include/stddef.h \
 /usr/include/bits/types.h /usr/include/bits/typesizes.h \
 /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
 /usr/lib/gcc/i686-pc-linux-gnu/4.4.3/include/stdarg.h \
 /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
 /usr/include/string.h /usr/include/xlocale.h /usr/include/getopt.h \
 assembler/vasm.h

Seems it doesn't prefix the vasm.o with the directory name, which might
be why the sed regexp broke. Any ideas or workarounds for this one? 

Thanks!
-- 
http://www.munted.org.uk

One very high maintenance cat living here.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]