summaryrefslogtreecommitdiffstats
path: root/make/include/base.defs
blob: 6e7999667fb7b212c67b69f9a66aa39247aeecc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
## Define module metadata.
## It is mandatory for every module to use this template.
##
## $(1) module name (uppercase)
## $(2) module name (lowercase)
## $(3) list of prerequisite modules (uppercase)
##
define import.MODULE.defs
    ## indicates module is defined; useful for conditionals
    $(1).enabled = 1

    ## module name (lowercase)
    $(1).name = $(2)

    ## module build directory
    ifeq (,$(4))
        $(1).dir = $(2)
    else
        $(1).dir = $(4)
    endif

    ## list of prerequisite modules (uppercase)
    $(1).prerequisites = $(3)

    ## add to global list of modules
    MODULES.NAMES += $(1)
    MODULES.names += $(2)
endef

##
## $(1) module name (uppercase)
##
define import.MODULE.rules
.PHONY: $($(1).name).build $($(1).name).clean 

$($(1).name).report:
	@$(MAKE) report.true REPORT=module REPORT.module=$(1)

## aggregate
report.modules:: $($(1).name).report

endef