* Vincent Lefevre wrote on Fri, Mar 21, 2008 at 03:01:30AM CET: > On 2008-03-21 00:24:20 +0100, Ralf Wildenhues wrote: > > * Vincent Lefevre wrote on Thu, Mar 20, 2008 at 01:26:21PM CET: > > > > > rm -f *.o > > > rm: invalid option -- . > > > Try `rm ./-.o' to remove the file `-.o'. > > > > Why would you do that, using non-portable file names? > > Such filenames can appear, even though they are not part of the source. > In particular, -.o can be generated by gcc. For instance: > > echo 'void tst(void) { }' | gcc -xc -c -
But you still can't pass such a file to the linker without additional hassles. So why not use 'gcc -xc -c -o ... -'? > In any case, "make clean" should not be confused by such filenames. I'm not convinced yet. Also, I don't know if rm understands '--' right on all weird systems out there (haven't checked though). > > > mostlyclean-compile: > > > -rm -f ./*.$(OBJEXT) > > > > FWIW, this wouldn't work (touch ./-a.o ./-b.o). > > No problem here. I don't see why this wouldn't work. Forget about that, thinko of mine. Hmm, maybe we can use this idiom. Cheers, Ralf