summaryrefslogtreecommitdiff
path: root/libdde-linux26/mk/subdir.mk
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-27 22:15:01 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-07-27 22:15:01 +0000
commit7996a3d79d55b7f879dfd62e202bbfe2963718d3 (patch)
tree8d9f6759fec4099b9be503c11c7ed174f7204980 /libdde-linux26/mk/subdir.mk
parent4fbe7358c7747a9165f776eb19addbb9baf7def2 (diff)
really properly move files
Diffstat (limited to 'libdde-linux26/mk/subdir.mk')
-rw-r--r--libdde-linux26/mk/subdir.mk64
1 files changed, 64 insertions, 0 deletions
diff --git a/libdde-linux26/mk/subdir.mk b/libdde-linux26/mk/subdir.mk
new file mode 100644
index 00000000..176200fe
--- /dev/null
+++ b/libdde-linux26/mk/subdir.mk
@@ -0,0 +1,64 @@
+# -*- Makefile -*-
+#
+# DROPS (Dresden Realtime OPerating System) Component
+#
+# Makefile-Template for directories containing only subdirs
+#
+# 05/2002 Jork Loeser <jork.loeser@inf.tu-dresden.de>
+
+#include $(L4DIR)/mk/Makeconf
+
+TARGET ?= $(patsubst %/Makefile,%,$(wildcard $(addsuffix /Makefile, \
+ idl src lib server examples doc)))
+SUBDIR_TARGET := $(if $(filter doc,$(MAKECMDGOALS)),$(TARGET), \
+ $(filter-out doc,$(TARGET)))
+
+all:: $(SUBDIR_TARGET) $(SUBDIRS)
+install::
+
+clean cleanall scrub::
+ $(VERBOSE)set -e; $(foreach d,$(TARGET), test -f $d/broken || \
+ if [ -f $d/Makefile ] ; then PWD=$(PWD)/$d $(MAKE) -C $d $@ $(MKFLAGS) $(MKFLAGS_$(d)); fi; )
+
+install oldconfig txtconfig relink::
+ $(VERBOSE)set -e; $(foreach d,$(TARGET), test -f $d/broken -o -f $d/obsolete || \
+ if [ -f $d/Makefile ] ; then PWD=$(PWD)/$d $(MAKE) -C $d $@ $(MKFLAGS) $(MKFLAGS_$(d)); fi; )
+
+# first the subdir-targets (this is were "all" will be build, e.g. in lib
+# or server.
+$(filter-out ptest,$(SUBDIR_TARGET)):
+ $(VERBOSE)test -f $@/broken -o -f $@/obsolete || \
+ if [ -f $@/Makefile ] ; then PWD=$(PWD)/$@ $(MAKE) -C $@ $(MKFLAGS) ; fi
+# Second, the rules for going down into sub-pkgs with "lib" and "server"
+# targets. Going down into sub-pkgs.
+ $(if $(SUBDIRS),$(if $(filter $@,idl include lib server examples doc),\
+ $(VERBOSE)set -e; for s in $(SUBDIRS); do \
+ PWD=$(PWD)/$$s $(MAKE) -C $$s $@ $(MKFLAGS); done ))
+
+idl include lib server examples doc:
+
+# the test target is something special:
+TEST_DEPENDS ?= server
+
+# check if the test directory exists, check if its broken or obsolete
+# to be able to specify additional dependencies, we make it a :: target
+ptest:: $(TEST_DEPENDS)
+ $(VERBOSE)test -f $@/broken -o -f $@/obsolete || \
+ if [ -f $@/Makefile ] ; then PWD=$(PWD)/$@ $(MAKE) -C $@ $(MKFLAGS) ; fi
+
+install-symlinks:
+ $(warning target install-symlinks is obsolete. Use 'include' instead (warning only))
+ $(VERBOSE)$(MAKE) include
+
+help::
+ @echo " all - build subdirs: $(SUBDIR_TARGET)"
+ $(if $(filter doc,$(TARGET)), \
+ @echo " doc - build documentation")
+ @echo " scrub - call scrub recursively"
+ @echo " clean - call clean recursively"
+ @echo " cleanall - call cleanall recursively"
+ @echo " install - build subdirs, install recursively then"
+ @echo " oldconfig - call oldconfig recursively"
+ @echo " txtconfig - call txtconfig recursively"
+
+.PHONY: $(TARGET) all clean cleanall help install oldconfig txtconfig