Stefan Hajnoczi writes: > On Wed, Apr 18, 2012 at 2:37 PM, Lluís Vilanova <vilan...@ac.upc.edu> wrote: >> Stefan Hajnoczi writes: >> >>> On Sat, Apr 14, 2012 at 12:19:03AM +0200, Lluís Vilanova wrote: >>>> - rm -f $(GENERATED_HEADERS) >>>> - rm -f $(GENERATED_SOURCES) >>>> + rm -f $(foreach f,$(GENERATED_HEADERS),$(f) $(f)-timestamp */$(f) >>>> */$(f)-timestamp) >>>> + rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp */$(f) >>>> */$(f)-timestamp) >> >>> Why */$(f) */$(f)-timestamp? >> >> Some of the files are generated in immediate subdirectories (e.g., >> libuser/trace.c-timestamp). >> >> I could use the results of a call shell to "find" instead, so that it will >> always find the right victims no matter where they are.
> Ah, I get it. This actually adds something that was missing previously. > I'm not a make expert, I think if we try we can find issues with any > approach to removing the files. What you've done seems fine to me :). What I meant is the following, so that it will always be correct no matter how directories are organized in the future: rm -f $(foreach f,$(GENERATED_HEADERS),$(shell find $(BUILD_DIR) -name $(f) -o -name $(f)-timestamp)) rm -f $(foreach f,$(GENERATED_SOURCES),$(shell find $(BUILD_DIR) -name $(f) -o -name $(f)-timestamp)) I'll resend this patch with the aforementioned changes. Lluis -- "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth