Reputation: 36229
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!
Upvotes: 0
Views: 66
Reputation: 16817
make
is invoked with a list of options followed by a list of targets.
So your example commandline will most likely gives errors about:
-a
and -c
arg1
, arg2
, etcI 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)
Upvotes: 3