[Top][All Lists]
[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 21:33:35 +0100 |
On Mon, 2010-06-07 at 15:37 +0000, Greg Chicares wrote:
> On 2010-06-07 14:48Z, Alex Buell wrote:
> >
> > $ gcc -M -ggdb3 assembler/vasm.c
> > vasm.o: assembler/vasm.c /usr/include/stdio.h /usr/include/features.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?
>
> This works well for me:
> http://make.paulandlesley.org/rules.html
> "Life is simplest if the targets are built in the current working directory."
>
> A less radical solution would be to make the 'sed' expression insert the
> directory you want, e.g. [untested]:
> - $(SED) 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < address@hidden > $@;
> + $(SED) 's,\($*\)\.o[ :]*,$(VASMDIR)\1.o $(VASMDIR)$@ : ,g' < address@hidden
> > $@;
> Or, if you use only gcc, '-MT' can control that (and, with other gnu cpp '-Mx'
> options, you can probably dispense with the 'sed' script).
I've just realised how wrong I've been. Reading the URL you have given
me has actually made me aware I could use VPATH instead of directories.
--
http://www.munted.org.uk
One very high maintenance cat living here.