Subsections

8.6 Role-File subdir.mk

8.6.1 Purpose

The purpose of the subdir role is to be a container for other directories and recursively build them. Therefore, most make-targets are recursively forwarded to subdirectories.

8.6.2 Make-Targets

install::
Phony target. Builds the targets in the given subdirs in $(TARGET) using make -C. Calls make install in the subdirs then.

all::, clean::, cleanall::, install::, oldconfig::, scrub::, txtconfig::
Phony targets. Call make {all, clean, cleanall, install, oldconfig, txtconfig, scrub} in the subdirectories.

config::
Phony target. Does nothing.

8.6.3 Required Parameters

PKGDIR If ``.'', additional dependencies are defined. If Makefiles in idl and include exist, include depends on idl. If Makefiles in include and lib resp. server exist, lib resp. server depend on include.

8.6.4 Optional Parameters

TARGET List of subdirectories to build. The build-order is unspecified unless other make dependencies apply. Default: a list of selected subdirectories that contain a Makefile. If PKGDIR is "." the default selection contains idl, include, src, lib, server, examples, doc. If PKGDIR is not ".", include is not in the default list.
MKFLAGS+ This value is passed to make when building a subdir. Default: empty.

8.6.5 Example

PKGDIR = ..
L4DIR ?= $(PKGDIR)/../..

TARGET = example1 easy complex
include $(L4DIR)/mk/subdir.mk

L4 Checker 2012-04-11