-FILES=$(wildcard */Makefile)
-DIRS=$(foreach f,$(FILES),$(dir $f))
+# Installation locations
+
+prefix=/usr/local
+bindir=$(prefix)/bin
+docdir=$(prefix)/doc/routino
+datadir=$(prefix)/share/routino
+
+# Sub-directories and sub-makefiles
+
+TOPFILES=$(wildcard */Makefile)
+TOPDIRS=$(foreach f,$(TOPFILES),$(dir $f))
+
+########
+
+all$(top):
+ for dir in $(TOPDIRS); do \
+ ( cd $$dir && $(MAKE) $@ ); \
+ done