question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add params for makefile

See original GitHub issue

Will be great have approach to put some arguments for make test or commands some like this.

For that we need add some like that into Makefile.

# arguments
FIRST_ARG := $(firstword $(MAKECMDGOALS))
ARGS = $(filter-out $@,$(MAKEOVERRIDES) $(MAKECMDGOALS))
MAKEFILE_PATH := $(abspath $(firstword $(MAKEFILE_LIST)))

%:
	@:

and after that add ${ARGS} to our commands

test:
	docker-compose run --rm app-test ${ARGS}

usage

make test -- my_param=some_param othe_param

u need:

  • generate ARGS variable
  • add this variable to all commands which need it
  • describe that into documentation

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:23 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Arfeycommented, May 8, 2020

This task connected only with this file.

https://github.com/aio-libs/create-aio-app/blob/master/create_aio_app/template/{{cookiecutter.project_name}}/Makefile

Here u can see all useful information for contributor.

https://github.com/aio-libs/create-aio-app/blob/master/CONTRIBUTING.md

if that’s not what you want to know, please explain better.

1reaction
Arfeycommented, May 8, 2020

Who know, but i’ll believe in u 😂 I think so this article will help u https://opensource.com/article/19/7/create-pull-request-github

Read more comments on GitHub >

github_iconTop Results From Across the Web

Passing additional variables from command line to make
Passing variables on the command line overrides assignments in the sub-makefile but exported variables do not override assignments in the sub-makefile. These ...
Read more >
Pass an option to a makefile - Unix & Linux Stack Exchange
@smarber You can't pass arguments to make without make interpreting them as its own command line flags, targets or variable assignments. – ...
Read more >
Passing Makefile arguments to a command, as they are typed ...
In my Python projects, I use a combination of Duty (my task runner) and make . My Makefile declares the same tasks as...
Read more >
Using Parameters in a Make Target - Chris Wiegman
This post explains how to call a Make target with parameters to allow for custom behavior specified while calling the target.
Read more >
Review - Makefiles & Command Line Arguments
Makefiles are used to perform compilation and linking steps. ... -fsanitize=leak,address - add memory leak checks and a few other address checks, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found