Avoid 'make clean' producing an 'rm' command which has a lot
of duplicate 'hw//*.o' arguments, by using $(sort $(dir ..))
rather than $(dir $(sort ..)) so Make's sort function will
remove the duplicates for us. We can also remove the double
'//' safely because $(dir ..) is guaranteed to return a string
ending in '/'.
Signed-off-by: Peter Maydell <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
@true
clean:
- rm -f $(addsuffix /*.o, $(dir $(sort $(hw-obj-y))))
- rm -f $(addsuffix /*.d, $(dir $(sort $(hw-obj-y))))
+ rm -f $(addsuffix *.o, $(sort $(dir $(hw-obj-y))))
+ rm -f $(addsuffix *.d, $(sort $(dir $(hw-obj-y))))
# Include automatically generated dependency files
-include $(patsubst %.o, %.d, $(hw-obj-y))