community.general.make (8.5.0) — module

Run targets in a Makefile

Authors: Linus Unnebäck (@LinusU) <linus@folkdatorn.se>

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Run targets in a Makefile.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Build the default target
  community.general.make:
    chdir: /home/ubuntu/cool-project
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Run 'install' target as root
  community.general.make:
    chdir: /home/ubuntu/cool-project
    target: install
  become: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Build 'all' target with extra arguments
  community.general.make:
    chdir: /home/ubuntu/cool-project
    target: all
    params:
      NUM_THREADS: 4
      BACKEND: lapack
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Build 'all' target with a custom Makefile
  community.general.make:
    chdir: /home/ubuntu/cool-project
    target: all
    file: /some-project/Makefile
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: build arm64 kernel on FreeBSD, with 16 parallel jobs
  community.general.make:
    chdir: /usr/src
    jobs: 16
    target: buildkernel
    params:
      # This adds -DWITH_FDT to the command line:
      -DWITH_FDT:
      # The following adds TARGET=arm64 TARGET_ARCH=aarch64 to the command line:
      TARGET: arm64
      TARGET_ARCH: aarch64

Inputs

    
file:
    description:
    - Use a custom Makefile.
    type: path

jobs:
    description:
    - Set the number of make jobs to run concurrently.
    - Typically if set, this would be the number of processors and/or threads available
      to the machine.
    - This is not supported by all make implementations.
    type: int
    version_added: 2.0.0
    version_added_collection: community.general

make:
    description:
    - Use a specific make binary.
    type: path
    version_added: 0.2.0
    version_added_collection: community.general

chdir:
    description:
    - Change to this directory before running make.
    required: true
    type: path

params:
    description:
    - Any extra parameters to pass to make.
    - If the value is empty, only the key will be used. For example, V(FOO:) will produce
      V(FOO), not V(FOO=).
    type: dict

target:
    description:
    - The target to run.
    - Typically this would be something like V(install), V(test), or V(all).
    - O(target) and O(targets) are mutually exclusive.
    type: str

targets:
    description:
    - The list of targets to run.
    - Typically this would be something like V(install), V(test), or V(all).
    - O(target) and O(targets) are mutually exclusive.
    elements: str
    type: list
    version_added: 7.2.0
    version_added_collection: community.general

Outputs

chdir:
  description:
  - The value of the module parameter O(chdir).
  returned: success
  type: str
command:
  description:
  - The command built and executed by the module.
  returned: success
  type: str
  version_added: 6.5.0
  version_added_collection: community.general
file:
  description:
  - The value of the module parameter O(file).
  returned: success
  type: str
jobs:
  description:
  - The value of the module parameter O(jobs).
  returned: success
  type: int
params:
  description:
  - The value of the module parameter O(params).
  returned: success
  type: dict
target:
  description:
  - The value of the module parameter O(target).
  returned: success
  type: str
targets:
  description:
  - The value of the module parameter O(targets).
  returned: success
  type: str
  version_added: 7.2.0
  version_added_collection: community.general