From cf5ec8e26dfd19cf3f5c53d016e84d65bbda3761 Mon Sep 17 00:00:00 2001 From: Pawel Lebioda Date: Mon, 26 Jan 2015 12:28:56 +0100 Subject: [PATCH] common: fix make clobber Ref: pmem/issues#26 --- Makefile | 2 +- src/Makefile | 14 +++++++++----- src/test/Makefile | 5 ++++- src/test/Makefile.inc | 4 ++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 74c135a2354..d961b8218b5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Intel Corporation +# Copyright (c) 2014-2015, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/src/Makefile b/src/Makefile index 5f9f814ba9e..2ff6ebe9eac 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,4 @@ -# Copyright (c) 2014, Intel Corporation +# Copyright (c) 2014-2015, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -36,6 +36,10 @@ export CSTYLE = $(abspath ../utils/cstyle) TARGETS = libpmem libvmem libpmemblk libpmemlog libpmemobj ALL_TARGETS = $(TARGETS) examples benchmarks +CLEAN_TARGETS = $(ALL_TARGETS) test +CLOBBER_TARGETS = $(ALL_TARGETS) test +CSTYLE_TARGETS = $(ALL_TARGETS) test +INSTALL_TARGETS = $(TARGETS) HEADERS_DESTDIR = $(DESTDIR)/usr/include HEADERS_INSTALL = include/libpmem.h include/libvmem.h include/libpmemobj.h include/libpmemblk.h include/libpmemlog.h @@ -54,10 +58,10 @@ SCOPE_HDR_FILES = $(foreach d, $(SCOPE_HDR_DIRS), $(wildcard $(D)/*.h)) SCOPEFILES = $(SCOPE_SRC_FILES) $(SCOPE_HDR_FILES) all: $(ALL_TARGETS) -install: $(TARGETS:=-install) -clean: $(ALL_TARGETS:=-clean) -clobber: $(ALL_TARGETS:=-clobber) -cstyle: $(ALL_TARGETS:=-cstyle) +install: $(INSTALL_TARGETS:=-install) +clean: $(CLEAN_TARGETS:=-clean) +clobber: $(CLOBBER_TARGETS:=-clobber) +cstyle: $(CSTYLE_TARGETS:=-cstyle) examples benchmarks: $(TARGETS) custom_build = $(DEBUG)$(OBJDIR) diff --git a/src/test/Makefile b/src/test/Makefile index aa3fa3a63c4..b87b4c23b36 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -83,7 +83,10 @@ clobber : TARGET = clobber test : TARGET = test cstyle : TARGET = cstyle -all clean clobber test cstyle: $(TEST) +all test cstyle: $(TEST) + +clean clobber: $(TEST) + $(MAKE) -C unittest $@ $(TEST): unittest $(MAKE) -C $@ $(TARGET) diff --git a/src/test/Makefile.inc b/src/test/Makefile.inc index fe03d0eee9c..301b95ccb44 100644 --- a/src/test/Makefile.inc +++ b/src/test/Makefile.inc @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Intel Corporation +# Copyright (c) 2014-2015, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -96,7 +96,7 @@ clean: $(RM) *.o */*.o core a.out *.log testfile* clobber: clean - $(RM) $(TARGET) $(TARGET).static-debug $(TARGET).static-nondebug + $(RM) $(TARGET) $(TARGET_STATIC_DEBUG) $(TARGET_STATIC_NONDEBUG) cstyle: ../../../utils/cstyle -pP *.[ch]