Aller au contenu

common_makefile.mk

1. Read-only variables

You can use them in your own Makefile but NEVER try to override these variables!

1.1 ROOT_DIR

Directory containing the "Makefile" (probably the root directory of the project)
  • Value: $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))

1.2 ROOT_TMP

Temporary directory (local to the project)
  • Value: $(ROOT_DIR)/.tmp

1.3 ROOT_TOOLS

Tools directory (local to the project)
  • Value: $(ROOT_DIR)/.tools

1.4 ROOT_COMMON

Common makefiles directory
  • Value: $(ROOT_DIR)/.common_makefiles

1.5 DEVENV_FILE

Devenv flag file (if it exists, the dev env is set up)
  • Value: $(ROOT_TOOLS)/devenv

1.6 RUNENV_FILE

Runenv flag file (if it exists, the run env is set up)
  • Value: $(ROOT_TOOLS)/runenv

2. Overridable variables

Note

you can use/override/extend these variables in your own Makefile.

2.1 GIT

Binary to use for git
  • Default: git

2.2 WGET

Binary to use for wget
  • Default: wget

2.3 COMMON_MAKEFILES_GIT_URL

Common makefiles git url (for refresh_makefiles target)
  • Default: http://github.com/meteofrance/common_makefiles.git

2.4 COMMON_MAKEFILES_GIT_BRANCH

Common makefiles git branch (for refresh_makefiles target)
  • Default: main

2.5 SHOW_HELP_WITH_ALL_TARGET

Display help with all target
1 => yes
0 => no
  • Default: 1

2.6 DEVENV_PREREQ

Devenv prerequisite list (use += to add some targets)
  • Default: (empty)

2.7 RUNENV_PREREQ

Runenv prerequisite list (use += to add some targets)
  • Default: (empty)

3. Targets ready to use

Note

You can't override these targets but you can use them!

3.1 devenv

Prepare devenv environment
  • Dependencies: $(EXTRA_PREREQ) $(DEVENV_FILE)

3.2 runenv

Prepare runenv environment
  • Dependencies: $(EXTRA_PREREQ) $(RUNENV_FILE)

3.3 lint

Lint the code
  • Dependencies: $(EXTRA_PREREQ) before_lint _lint custom_lint _after_lint

3.4 reformat

Reformat the code
  • Dependencies: $(EXTRA_PREREQ) before_reformat _reformat custom_reformat _after_reformat

3.5 clean

Clean the code
  • Dependencies: $(EXTRA_PREREQ) before_clean _clean custom_clean _after_clean

3.6 distclean

Distclean the code
  • Dependencies: $(EXTRA_PREREQ) clean before_distclean _distclean custom_distclean _after_distclean

3.7 check

Check the code
  • Dependencies: $(EXTRA_PREREQ) before_check _check custom_check _after_check

3.8 coverage

Coverage the code
  • Dependencies: $(EXTRA_PREREQ) before_coverage _coverage custom_coverage _after_coverage

3.9 refresh_common_makefiles

Refresh common makefiles from repository

3.10 tests

simple alias of check target
  • Dependencies: check

4. Extendable targets

Note

You can extend these targets in your own Makefile with target_name:: syntax.

4.1 before_lint

target executed before lint target
  • Dependencies: devenv

4.2 custom_lint

custom linting target

4.3 before_reformat

target executed before reformat target
  • Dependencies: devenv

4.4 custom_reformat

custom reformating target

4.5 before_clean

target executed before clean target

4.6 custom_clean

custom cleaning target

4.7 before_distclean

target executed before distclean target

4.8 custom_distclean

custom distcleaning target

4.9 before_check

target executed before check target
  • Dependencies: devenv

4.10 custom_check

custom checking target

4.11 before_coverage

target executed before coverage target
  • Dependencies: devenv

4.12 custom_coverage

custom coverageing target

4.13 _debug

Dump common_makefiles configuration