summaryrefslogtreecommitdiffstats
path: root/make/include/base.defs
blob: 3b4e666f384869189debc23e80edfa3d3e937b84 (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
43
44
45
46
47
48
49
50
## 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)

    ## 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
$($(1).name).report:
	@$(MAKE) report.true REPORT=module REPORT.module=$(1)

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

endef

.PHONY: report.main report.gcc report.modules

report.modules::

.PHONY: report.main
report.main:
	@$(MAKE) report.true REPORT=main

.PHONY: report.gcc
report.gcc:
	@$(MAKE) report.true REPORT=gcc

## needed for nested make (which drives each report)
.PHONY: report.true
report.true:
	@true