# HG changeset patch
# User Markus Bröker <mbroeker@largo.dyndns.tv>
# Date 1229179338 -3600
# Node ID ef929533d040201c980a555e068460b4f4bb5ec3
# Parent  4a2f7a1492ab7d68af224749f4af1c3c65d6df1a
Default Makefile for Cmake based projects

committer: Markus Bröker <mbroeker@largo.homelinux.org>

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+*~
+*.[oae]
 build/
 locale/de/LC_MESSAGES/mcbot.mo
 
diff --git a/Makefile b/Makefile
new file mode 100644
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,31 @@
+MAKE=make --no-print-directory
+CMAKE=cmake
+RMDIR=rm -rf
+RM=rm -f
+
+ALL: build
+
+build: build/Makefile
+	@$(MAKE) -C build
+
+prepare:
+	@if [ ! -d build ]; then mkdir build; fi
+
+build/Makefile: prepare
+	cd build && $(CMAKE) ../src
+
+.PHONY: distclean prepare beauty
+
+clean: build/Makefile
+	@$(MAKE) -C build clean
+
+distclean:
+	$(RMDIR) build
+
+install: build/Makefile
+	$(MAKE) -C build install
+
+beauty:
+	find -name '*.[ch]' -exec indent {} \;
+	find -name '*.[ch]' -exec eraser {} \;
+	find -name '*~' -exec rm -f {} \;