summaryrefslogtreecommitdiff
path: root/makefiles/gmake/top.mk
diff options
context:
space:
mode:
Diffstat (limited to 'makefiles/gmake/top.mk')
-rw-r--r--makefiles/gmake/top.mk48
1 files changed, 48 insertions, 0 deletions
diff --git a/makefiles/gmake/top.mk b/makefiles/gmake/top.mk
new file mode 100644
index 0000000..8463c53
--- /dev/null
+++ b/makefiles/gmake/top.mk
@@ -0,0 +1,48 @@
+# top-level makefile for a package
+#
+# requires:
+# - TOPDIR
+# - SUBDIRS
+#
+# provides:
+# - target 'all'
+# - target 'clean'
+# - target 'distclean'
+# - target 'test'
+# - target 'doc'
+# - target 'dist'
+# - target 'help'
+
+.PHONY: all
+all:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d all || exit 1); done)
+
+.PHONY: clean
+clean:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d clean || exit 1); done)
+
+.PHONY: distclean
+distclean:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d distclean || exit 1); done)
+
+.PHONY: install
+install:
+ @test -z "$(SUBDIRS)" || ( set -e; for d in $(SUBDIRS)""; do \
+ (set -e; $(MAKE) -C $$d install || exit 1); done)
+
+.PHONY: test
+test: all
+ @$(MAKE) -C tests test
+
+.PHONY: doc
+doc:
+ cd docs; $(MAKE) doc
+
+.PHONY: help
+help:
+ @cat makefiles/help.mk
+
+-include $(TOPDIR)/makefiles/gmake/dist.mk