summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-12-13 16:18:53 +0900
committerSimon Horman <horms@verge.net.au>2007-12-19 14:50:07 +0900
commit4b3340f33467aa1bebfa05791dc53bbaf1028381 (patch)
tree124e1bec919e133fe6558ff023afc457ac906517
parent3f871456d4d350b5abdb2b7fdcfedec5743d6db2 (diff)
downloadkexec-tools-4b3340f33467aa1bebfa05791dc53bbaf1028381.tar.gz
make clean cleanup
Use a $(clean) variable to store all items that need to be removed on 'make clean' (eg, .o files). Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Simon Horman <horms@verge.net.au> Conflicts: Makefile.in
-rw-r--r--Makefile.in20
-rw-r--r--kdump/Makefile2
-rw-r--r--kexec/Makefile3
-rw-r--r--kexec_test/Makefile2
-rw-r--r--purgatory/Makefile2
-rw-r--r--util/Makefile2
-rw-r--r--util_lib/Makefile2
7 files changed, 20 insertions, 13 deletions
diff --git a/Makefile.in b/Makefile.in
index 7df7032..cf1befa 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -120,6 +120,9 @@ all: $(TARGETS)
@$(MKDIR) -p $(@D)
$(COMPILE.S) -MD -o $@ $<
+# collect objects to be removed in 'make clean'
+clean =
+
# utility function for converting a list of files (with extension) to
# file.o (or file.d) format.
objify = $(addsuffix .o, $(basename $(1)))
@@ -215,23 +218,14 @@ echo::
@echo LD=$(LD)
clean:
- @$(FIND) $(OBJDIR) -name '*.o' -type f | $(XARGS) $(RM) rm -f
- @$(RM) -rf rpm
- @$(RM) -f config.log config.status config.cache
- @$(RM) -f $(TARBALL)
+ $(RM) -f $(clean)
+ $(RM) -rf rpm build
+ $(RM) -f $(TARBALL) $(TARBALL.gz)
distclean: dist-clean
dist-clean: clean
- @$(RM) -rf $(OBJDIR)
- @$(FIND) . -type f -name '*~' -o -name '*.orig' | $(XARGS) $(RM) -f
- @$(RM) -f Makefile.conf
-
-maintainerclean: maintainer-clean
-
-maintainer-clean: dist-clean
- @$(RM) -f $(GENERATED_SRCS)
-
+ $(RM) -f config.log config.status config.cache Makefile include/config.h
install: $(TARGETS)
for file in $(TARGETS) ; do \
diff --git a/kdump/Makefile b/kdump/Makefile
index 2c8f9ea..25c187b 100644
--- a/kdump/Makefile
+++ b/kdump/Makefile
@@ -10,6 +10,8 @@ KDUMP_DEPS = $(call depify, $(KDUMP_OBJS))
KDUMP = $(SBINDIR)/kdump
KDUMP_MANPAGE = $(MANDIR)/man8/kdump.8
+clean += $(KDUMP_OBJS) $(KDUMP_DEPS) $(KDUMP) $(KDUMP_MANPAGE)
+
-include $(KDUMP_DEPS)
$(KDUMP): $(KDUMP_OBJS)
diff --git a/kexec/Makefile b/kexec/Makefile
index 3d9db29..29534d0 100644
--- a/kexec/Makefile
+++ b/kexec/Makefile
@@ -28,6 +28,9 @@ include $(srcdir)/kexec/arch/$(ARCH)/Makefile
KEXEC_OBJS = $(call objify, $(KEXEC_SRCS) $(KEXEC_GENERATED_SRCS))
KEXEC_DEPS = $(call depify, $(KEXEC_OBJS))
+clean += $(KEXEC_OBJS) $(KEXEC_DEPS) $(KEXEC_GENERATED_SRCS) \
+ $(KEXEC) $(KEXEC_MANPAGE)
+
KEXEC = $(SBINDIR)/kexec
KEXEC_MANPAGE = $(MANDIR)/man8/kexec.8
diff --git a/kexec_test/Makefile b/kexec_test/Makefile
index 4a7d94c..3f0d0fe 100644
--- a/kexec_test/Makefile
+++ b/kexec_test/Makefile
@@ -9,6 +9,8 @@ KEXEC_TEST_DEPS = $(call depify, $(KEXEC_TEST_OBJS))
KEXEC_TEST = $(PKGLIBDIR)/kexec_test
+clean += $(KEXEC_TEST_OBJS) $(KEXEC_TEST_DEPS) $(KEXEC_TEST)
+
-include $(KEXEC_TEST_DEPS)
$(KEXEC_TEST): CPPFLAGS+=-DRELOC=$(RELOC)
diff --git a/purgatory/Makefile b/purgatory/Makefile
index 852ead9..a543cdb 100644
--- a/purgatory/Makefile
+++ b/purgatory/Makefile
@@ -18,6 +18,8 @@ include $(srcdir)/purgatory/arch/$(ARCH)/Makefile
PURGATORY_OBJS = $(call objify, $(PURGATORY_SRCS)) purgatory/sha256.o
PURGATORY_DEPS = $(call depify, $(PURGATORY_OBJS))
+clean += $(PURGATORY_OBJS) $(PURGATORY_DEPS) $(PURGATORY)
+
-include $(PURGATORY_DEPS)
# sha256.c needs to be compiled without optimization, else
diff --git a/util/Makefile b/util/Makefile
index 5105652..6fee925 100644
--- a/util/Makefile
+++ b/util/Makefile
@@ -6,3 +6,5 @@ $(BIN_TO_HEX): $(srcdir)/util/bin-to-hex.c
$(BIN_TO_HEX): CC=$(BUILD_CC)
$(BIN_TO_HEX): CFLAGS=$(BUILD_CFLAGS)
+
+clean += util/bin-to-hex.o $(BIN_TO_HEX)
diff --git a/util_lib/Makefile b/util_lib/Makefile
index 35ee9e7..5b4bd22 100644
--- a/util_lib/Makefile
+++ b/util_lib/Makefile
@@ -10,6 +10,8 @@ UTIL_LIB = libutil.a
-include $(UTIL_LIB_DEPS)
+clean += $(UTIL_LIB_OBJS) $(UTIL_LIB_DEPS) $(UTIL_LIB)
+
$(UTIL_LIB): CPPFLAGS += -I$(srcdir)/util_lib/include
$(UTIL_LIB): $(UTIL_LIB_OBJS)