Skip to contentSkip to conversation

tools/libfsimage: Fix clean and distclean make targets

PATCH In review Daniel Kiper 2 participants 2 messages May 10, 2013 – May 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tools/libfsimage: Fix clean and distclean make targets

If there is a single colon for a given target and the target is redefined in another place (e.g. in included file) then make executes only new target and displays following warning:

Makefile:35: warning: overriding commands for target `clean' tools/libfsimage/common/../../../tools/libfsimage/Rules.mk:25:
warning: ignoring old commands for target `clean'

To cope with that issue define all required targets as double-colon rules. Additionally, remove some redundant stuff.

---
 tools/libfsimage/Rules.mk        |    2 +-
 tools/libfsimage/common/Makefile |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
tools/libfsimage/Rules.mk +1 -1
index e4b2a91..8a23655 100644
@@ -21,7 +21,7 @@ fs-install: fs-all
 $(FSLIB): $(PIC_OBJS)
 	$(CC) $(LDFLAGS) $(SHLIB_LDFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS) $(APPEND_LDFLAGS)
 
-clean distclean:
+clean distclean::
 	rm -f $(PIC_OBJS) $(FSLIB) $(DEPS)
 
 -include $(DEPS)
tools/libfsimage/common/Makefile +2 -2
index f0ee3ab..cbd60b4 100644
@@ -31,8 +31,8 @@ install: all
 	$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(INCLUDEDIR)
 	$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(INCLUDEDIR)
 
-clean distclean:
-	rm -f $(PIC_OBJS) $(LIB) $(DEPS)
+clean distclean::
+	rm -f $(LIB)
 
 libfsimage.so: libfsimage.so.$(MAJOR)
 	ln -sf $< $@
Signature · 1 line
1.7.10.4
Acked-by on v2 1/1
#1 lore raw
Quoted 4 lines · Daniel Kiper

If there is a single colon for a given target and the target is redefined in another place (e.g. in included file) then make executes only new target and displays following warning:

Quoted 8 lines

Makefile:35: warning: overriding commands for target `clean' tools/libfsimage/common/../../../tools/libfsimage/Rules.mk:25:
warning: ignoring old commands for target `clean'

To cope with that issue define all required targets as double-colon rules. Additionally, remove some redundant stuff.

and pushed