summaryrefslogtreecommitdiff
path: root/makefiles/gmake/clean.mk
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2010-02-13 09:56:58 +0100
committerAndreas Baumann <abaumann@yahoo.com>2010-02-13 09:56:58 +0100
commit68354c7d41085d1f976a5b1d7ee542479a85f621 (patch)
treeaec761c793093e4a2e4ce18d78b3b531bcb12a42 /makefiles/gmake/clean.mk
downloadsqlitexx-68354c7d41085d1f976a5b1d7ee542479a85f621.tar.gz
sqlitexx-68354c7d41085d1f976a5b1d7ee542479a85f621.tar.bz2
imported trunk from sourceforge SVN
Diffstat (limited to 'makefiles/gmake/clean.mk')
-rw-r--r--makefiles/gmake/clean.mk41
1 files changed, 41 insertions, 0 deletions
diff --git a/makefiles/gmake/clean.mk b/makefiles/gmake/clean.mk
new file mode 100644
index 0000000..92061d4
--- /dev/null
+++ b/makefiles/gmake/clean.mk
@@ -0,0 +1,41 @@
+# cleans up directories
+#
+# requires:
+# - SUBDIRS: for recursive cleaning
+# - local_clean, local_distclean targets in local GNUmakefile
+# - all artifacts to clean:
+# - BINS, TEST_BINS, TEST_CPP_BINS, CPP_BINS
+# - OBJS, CPPOBJS, BIN_OBJS, TEST_BIN_OBJS, CPP_BIN_OBJS, TEST_CPP_BIN_OBJS
+# - CMODULES, CPPMODULES
+#
+# provides:
+# - target: clean
+# - target: distclean
+
+.PHONY: clean_recursive clean local_clean
+
+clean_recursive:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d clean || exit 1); done)
+
+clean: clean_recursive clean_po local_clean
+ -@rm -f *.bak 2>/dev/null
+ -@rm -f *~ 2>/dev/null
+ -@rm -f *.d port/*.d 2>/dev/null
+ -@rm -f $(BINS) $(CPP_BINS) $(TEST_BINS) $(TEST_CPP_BINS) 2>/dev/null
+ -@rm -f $(OBJS) $(CPP_OBJS) $(BIN_OBJS) $(TEST_BIN_OBJS) $(CPP_BIN_OBJS) $(TEST_CPP_BIN_OBJS) 2>/dev/null
+ -@rm -f exec/* 2>/dev/null
+ -@rm -f *.core 2>/dev/null
+ -@rm -f $(CMODULES) $(CPPMODULES) 2>/dev/null
+ -@rm -f $(CMODULES:.o=.d) $(CPPMODULES:.o=.d) 2>/dev/null
+ -@rm -rf $(STATIC_LIB) 2>/dev/null
+ -@rm -rf $(DYNAMIC_LIB).$(DYNAMIC_LIB_MAJOR).$(DYNAMIC_LIB_MINOR).$(DYNAMIC_LIB_PATCH) 2>/dev/null
+ -@rm -f $(SH_OBJS) rm -f $(SHPP_OBJS) 2>/dev/null
+
+.PHONY: distclean_recursive distclean local_distclean
+
+distclean_recursive:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d distclean || exit 1); done)
+
+distclean: distclean_recursive local_distclean clean