List Info

Thread: Re: gmake help with removing duplicate files




Re: gmake help with removing duplicate files
country flaguser name
United States
2008-02-20 12:25:12
Ralf,

Thanks for you response.  Unfortunately, your suggestion is
does not
work.

> > I have an interesting filter problem (I think).  I
would like to
> > remove duplicate filenames
>
> Why would you need that?
>

The short answer is the final list is for a linker and the
linker
complains of multiply defined symbols.  The long answer is
that final
list is constructed from a small set of local objects and a
very large
set of remote objects to allow a user to link an application
without
recompile of the entire project (or even ownership of the
entire pr

> > LIST1 := file1.o file2.o file3.o
> > LIST2 := path/file3.o path/file4.o path/file5.o
> >
> > Desired result of:
> >
> > LIST := file1.o file2.o file3.o path/file4.o
path/file5.o
>
> With GNU make, use $(sort $(LIST1) $(LIST2)).

This will return:

file1.o file2.o file3.o path/file3.o path/file4.o
path/file5.o

which has the duplicates file3.o and path/file3.o.  The sort
function
uses the entire filepath/name string rather than just the
filename.

Re: gmake help with removing duplicate files
user name
2008-02-20 12:52:08
* Jonathan wrote on Wed, Feb 20, 2008 at 07:25:12PM CET:
> 
> > > I have an interesting filter problem (I
think).  I would like to
> > > remove duplicate filenames
> >
> > Why would you need that?
> 
> The short answer is the final list is for a linker and
the linker
> complains of multiply defined symbols.  The long answer
is that final
> list is constructed from a small set of local objects
and a very large
> set of remote objects to allow a user to link an
application without
> recompile of the entire project (or even ownership of
the entire pr

I think you want to use an archive (a static library) for
your "remote
objects".

> > With GNU make, use $(sort $(LIST1) $(LIST2)).
> 
> This will return:
> 
> file1.o file2.o file3.o path/file3.o path/file4.o
path/file5.o
> 
> which has the duplicates file3.o and path/file3.o.  The
sort function
> uses the entire filepath/name string rather than just
the filename.

I'm sure GNU make's functions can be hacked to provide this,
but I don't
think it's worth it, see above.

Cheers,
Ralf



[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )