0

I have a bin/test.sh file that I call from my makefile:

test:
    bin/test.sh

I like to pass ALL arguments (i.e. $@) to my test file so if I were to do make test -a arg1 -b arg2 -c arg3 -d my test file would get all of -a arg1 -b arg2 -c arg3 -d.

I don't want to define all of these arguments manually in test file; I just want to pass everything!

1 Answer 1

3

make is invoked with a list of options followed by a list of targets.

So your example commandline will most likely gives errors about:

  • undefined options -a and -c
  • no rule to build targets arg1, arg2, etc

I think about the closest to what you seem to be asking for will be something like:

TEST_ARGS='-a arg1 -b arg2 -c arg3 -d' make test

with a Makefile containing:

test:
    bin/test.sh $(TEST_ARGS)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.