build: define a common Makefile clean command

Use $(CLEAN_C) throughout the Makefiles to clean up a consistent set of
generated files.

This also adds coverage files to the list of cleaned files.

Change-Id: Iceb922935a45c9eecbf2f3443bd0ee4f5c966825
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Daniel Verkamp 2015-12-07 15:14:36 -07:00
parent af2a731de3
commit 01b48b7c90
10 changed files with 13 additions and 9 deletions

View File

@ -52,6 +52,6 @@ $(APP) : $(OBJS) $(SPDK_LIBS)
$(LINK_C)
clean :
$(Q)rm -f $(OBJS) *.d $(APP)
$(CLEAN_C) $(APP)
include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk

View File

@ -57,6 +57,6 @@ $(APP) : $(OBJS) $(SPDK_LIBS)
$(LINK_C)
clean :
$(Q)rm -f $(OBJS) *.d $(APP)
$(CLEAN_C) $(APP)
include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk

View File

@ -43,7 +43,7 @@ LIB = libspdk_memory.a
all : $(LIB)
clean :
$(Q)rm -f $(LIB) $(OBJS) *.d
$(CLEAN_C)
$(LIB) : $(OBJS)
$(LIB_C)

View File

@ -43,7 +43,7 @@ LIB = libspdk_nvme.a
all : $(LIB)
clean :
$(Q)rm -f $(LIB) $(OBJS) *.d
$(CLEAN_C)
$(LIB) : $(OBJS)
$(LIB_C)

View File

@ -43,7 +43,7 @@ LIB = libspdk_util.a
all : $(LIB)
clean :
$(Q)rm -f $(LIB) $(OBJS) *.d
$(CLEAN_C)
$(LIB) : $(OBJS)
$(LIB_C)

View File

@ -50,7 +50,7 @@ $(APP) : $(OBJS)
$(LINK_C)
clean:
$(Q)rm -f $(APP) $(OBJS) *.d
$(CLEAN_C) $(APP)
%.o: $(NVME_DIR)/%.c %.d $(MAKEFILE_LIST)
$(COMPILE_C)

View File

@ -108,6 +108,10 @@ LIB_C=\
$(Q)echo " LIB $@"; \
ar crDs $@ $(OBJS)
# Clean up generated files listed as arguments plus a default list
CLEAN_C=\
$(Q)rm -f *.a *.o *.d *.d.tmp *.gcno *.gcda
%.o: %.c %.d $(MAKEFILE_LIST)
$(COMPILE_C)

View File

@ -50,6 +50,6 @@ $(APP): $(OBJS) $(SPDK_LIBS)
$(LINK_C)
clean:
$(Q)rm -f $(OBJS) *.d $(APP)
$(CLEAN_C) $(APP)
include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk

View File

@ -52,6 +52,6 @@ $(APP) : $(OBJS) $(SPDK_LIBS)
$(LINK_C)
clean :
$(Q)rm -f $(OBJS) *.d $(APP)
$(CLEAN_C) $(APP)
include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk

View File

@ -58,6 +58,6 @@ $(APP) : $(OBJS) $(SPDK_LIBS)
$(Q)$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
clean :
$(Q)rm -f $(OBJS) *.d $(APP)
$(CLEAN_C) $(APP)
include $(SPDK_ROOT_DIR)/mk/spdk.deps.mk