Repository: ansible-collections/community.general

Issue:
community.general.make params without value
### Summary

Sometimes, parameters of make do not look like "foo=bar" but just 'foo'  or '-foo'.
For example on FreeBSD,  one can build the system like this: `make buildworld -DWITH_FDT`, as show here: [https://wiki.freebsd.org/FlattenedDeviceTree#FreeBSD_buildworld_WITH_FDT](https://wiki.freebsd.org/FlattenedDeviceTree#FreeBSD_buildworld_WITH_FDT).
But this case does not seem to be manageable as of now. 
For example,
```
community.general.make:
  target: buildworld
  chdir: "{{ freebsd_src_dir }}"
  params:
    -DWITH_FDT: ""
```
becomes `make buildworld -DWITH_FDT=""`

and

```
community.general.make:
  target: buildworld
  chdir: "{{ freebsd_src_dir }}"
  params:
    -DWITH_FDT:
```
becomes `make buildworld -DWITH_FDT=None` 

Do you think it could be implemented ? 

IDEA: I might be wrong, but setting =None as a value is maybe not useful, I do not think this behavior is expected by a user. Instead, it could be set to nothing and fit the case I am talking about.
I do not know if I am clear here so in other words, 
```
  params:
    -DWITH_FDT:
```
could remain `-DWITH_FDT` instead of becoming` -DWITH_FDT=None`

What do you think ?

### Issue Type

Feature Idea

### Component Name

make

### Additional Information

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
community.general.make:
  target: buildworld
  chdir: "{{ freebsd_src_dir }}"
  params:
    -DWITH_FDT:
```
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
community.general.make params without value
### Summary

Sometimes, parameters of make do not look like "foo=bar" but just 'foo'  or '-foo'.
For example on FreeBSD,  one can build the system like this: `make buildworld -DWITH_FDT`, as show here: [https://wiki.freebsd.org/FlattenedDeviceTree#FreeBSD_buildworld_WITH_FDT](https://wiki.freebsd.org/FlattenedDeviceTree#FreeBSD_buildworld_WITH_FDT).
But this case does not seem to be manageable as of now. 
For example,
```
community.general.make:
  target: buildworld
  chdir: "{{ freebsd_src_dir }}"
  params:
    -DWITH_FDT: ""
```
becomes `make buildworld -DWITH_FDT=""`

and

```
community.general.make:
  target: buildworld
  chdir: "{{ freebsd_src_dir }}"
  params:
    -DWITH_FDT:
```
becomes `make buildworld -DWITH_FDT=None` 

Do you think it could be implemented ? 

IDEA: I might be wrong, but setting =None as a value is maybe not useful, I do not think this behavior is expected by a user. Instead, it could be set to nothing and fit the case I am talking about.
I do not know if I am clear here so in other words, 
```
  params:
    -DWITH_FDT:
```
could remain `-DWITH_FDT` instead of becoming` -DWITH_FDT=None`

What do you think ?

### Issue Type

Feature Idea

### Component Name

make

### Additional Information

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
community.general.make:
  target: buildworld
  chdir: "{{ freebsd_src_dir }}"
  params:
    -DWITH_FDT:
```
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/make.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/make.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @LinusU
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->
Files identified in the description:
* [`plugins/modules/make.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/make.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @LinusU
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/plugins/modules/make.py b/plugins/modules/make.py
--- a/plugins/modules/make.py
+++ b/plugins/modules/make.py
@@ -49,6 +49,7 @@
   params:
     description:
       - Any extra parameters to pass to make.
+      - If the value is empty, only the key will be used. For example, C(FOO:) will produce C(FOO), not C(FOO=).
     type: dict
   target:
     description:
@@ -81,6 +82,18 @@
     chdir: /home/ubuntu/cool-project
     target: all
     file: /some-project/Makefile
+
+- 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
 '''
 
 RETURN = r'''
@@ -174,7 +187,7 @@ def main():
             make_path = module.get_bin_path('make', required=True)
     make_target = module.params['target']
     if module.params['params'] is not None:
-        make_parameters = [k + '=' + str(v) for k, v in iteritems(module.params['params'])]
+        make_parameters = [k + (('=' + str(v)) if v is not None else '') for k, v in iteritems(module.params['params'])]
     else:
         make_parameters = []
 


Test patch: