From f1f32a2ff565d98dd41326342eb05efc12fdb886 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Tue, 16 Feb 2016 23:24:05 +1100 Subject: [PATCH] Clean up use of 'rm' in Makefiles Most of the ccan Makefiles use $(RM) to remove files. However, 'rm' is traditionally considered one of the few shell tools which can be used in Makefiles without indirecting via a variable. rm is also typically invoked with -f in Makefiles, so that it doesn't cause errors if the files don't exist (because they haven't been built). A number of instances in ccan were missing this. This corrects these warts. Signed-off-by: David Gibson --- Makefile | 6 +++--- ccan/cdump/tools/Makefile | 2 +- ccan/crypto/sha256/benchmarks/Makefile | 2 +- ccan/io/benchmarks/Makefile | 2 +- ccan/timer/benchmarks/Makefile | 2 +- tools/Makefile | 2 +- tools/ccanlint/Makefile | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 856baa90..5d4b701c 100644 --- a/Makefile +++ b/Makefile @@ -64,9 +64,9 @@ ccan/%/info: ccan/%/_info $(CC) $(CCAN_CFLAGS) -o $@ -x c $< clean: tools-clean - $(RM) `find * -name '*.o'` `find * -name '.depends'` `find * -name '*.a'` `find * -name info` `find * -name '*.d'` `find ccan -name '*-Makefile'` - $(RM) config.h - $(RM) inter-depends lib-depends test-depends + rm -f `find * -name '*.o'` `find * -name '.depends'` `find * -name '*.a'` `find * -name info` `find * -name '*.d'` `find ccan -name '*-Makefile'` + rm -f config.h + rm -f inter-depends lib-depends test-depends # Creates a dependency from the tests to the object files which it needs. inter-depends: $(ALL_DEPENDS) Makefile diff --git a/ccan/cdump/tools/Makefile b/ccan/cdump/tools/Makefile index 3b30d661..8b012845 100644 --- a/ccan/cdump/tools/Makefile +++ b/ccan/cdump/tools/Makefile @@ -5,7 +5,7 @@ CFLAGS := -I$(CCANDIR) -Wall cdump-enumstr: cdump-enumstr.o $(CCAN_OBJS) clean: - $(RM) cdump-enumstr.o $(CCAN_OBJS) + rm -f cdump-enumstr.o $(CCAN_OBJS) ccan-tal.o: $(CCANDIR)/ccan/tal/tal.c $(CC) $(CFLAGS) -c -o $@ $< diff --git a/ccan/crypto/sha256/benchmarks/Makefile b/ccan/crypto/sha256/benchmarks/Makefile index a9f1b29f..f1749ab5 100644 --- a/ccan/crypto/sha256/benchmarks/Makefile +++ b/ccan/crypto/sha256/benchmarks/Makefile @@ -12,7 +12,7 @@ $(INTEL_OBJS): %.o : %.asm yasm -f x64 -f elf64 -X gnu -g dwarf2 -D LINUX -o $@ $< clean: - $(RM) -f *.o + rm -f *.o ccan-crypto-sha256.o: $(CCANDIR)/ccan/crypto/sha256/sha256.c $(CC) $(CFLAGS) -c -o $@ $< diff --git a/ccan/io/benchmarks/Makefile b/ccan/io/benchmarks/Makefile index 0068400d..7dcf9beb 100644 --- a/ccan/io/benchmarks/Makefile +++ b/ccan/io/benchmarks/Makefile @@ -26,4 +26,4 @@ err.o: $(CCANDIR)/ccan/err/err.c $(CC) $(CFLAGS) -c -o $@ $< clean: - $(RM) -f *.o $(ALL) + rm -f *.o $(ALL) diff --git a/ccan/timer/benchmarks/Makefile b/ccan/timer/benchmarks/Makefile index 7e0653ab..a3cbbd12 100644 --- a/ccan/timer/benchmarks/Makefile +++ b/ccan/timer/benchmarks/Makefile @@ -32,4 +32,4 @@ list.o: $(CCANDIR)/ccan/list/list.c $(CC) $(CFLAGS) -c -o $@ $< clean: - $(RM) *.o $(ALL) + rm -f *.o $(ALL) diff --git a/tools/Makefile b/tools/Makefile index 338befc4..6e4833a3 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -45,6 +45,6 @@ tools/configurator/configurator: tools/configurator/configurator.c tools/modfiles: tools/modfiles.o tools/manifest.o $(DEP_OBJS) tools-clean: ccanlint-clean - $(RM) $(ALL_TOOLS) + rm -f $(ALL_TOOLS) include tools/ccanlint/Makefile diff --git a/tools/ccanlint/Makefile b/tools/ccanlint/Makefile index 691f2708..5a266796 100644 --- a/tools/ccanlint/Makefile +++ b/tools/ccanlint/Makefile @@ -47,4 +47,4 @@ $(CORE_OBJS): config.h tools/ccanlint/ccanlint: $(OBJS) ccanlint-clean: - $(RM) tools/ccanlint/ccanlint + rm -f tools/ccanlint/ccanlint -- 2.39.2