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 <david@gibson.dropbear.id.au>
$(CC) $(CCAN_CFLAGS) -o $@ -x c $<
clean: tools-clean
$(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
# Creates a dependency from the tests to the object files which it needs.
inter-depends: $(ALL_DEPENDS) Makefile
cdump-enumstr: cdump-enumstr.o $(CCAN_OBJS)
clean:
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 $@ $<
ccan-tal.o: $(CCANDIR)/ccan/tal/tal.c
$(CC) $(CFLAGS) -c -o $@ $<
yasm -f x64 -f elf64 -X gnu -g dwarf2 -D LINUX -o $@ $<
clean:
yasm -f x64 -f elf64 -X gnu -g dwarf2 -D LINUX -o $@ $<
clean:
ccan-crypto-sha256.o: $(CCANDIR)/ccan/crypto/sha256/sha256.c
$(CC) $(CFLAGS) -c -o $@ $<
ccan-crypto-sha256.o: $(CCANDIR)/ccan/crypto/sha256/sha256.c
$(CC) $(CFLAGS) -c -o $@ $<
$(CC) $(CFLAGS) -c -o $@ $<
clean:
$(CC) $(CFLAGS) -c -o $@ $<
clean:
$(CC) $(CFLAGS) -c -o $@ $<
clean:
$(CC) $(CFLAGS) -c -o $@ $<
clean:
tools/modfiles: tools/modfiles.o tools/manifest.o $(DEP_OBJS)
tools-clean: ccanlint-clean
tools/modfiles: tools/modfiles.o tools/manifest.o $(DEP_OBJS)
tools-clean: ccanlint-clean
include tools/ccanlint/Makefile
include tools/ccanlint/Makefile
tools/ccanlint/ccanlint: $(OBJS)
ccanlint-clean:
tools/ccanlint/ccanlint: $(OBJS)
ccanlint-clean:
- $(RM) tools/ccanlint/ccanlint
+ rm -f tools/ccanlint/ccanlint