I come from the NodeJS world so I consider the Makefile as the "scripts" part in an npm package.json
, which may be wrong (or not ?) to do so.
So my idea is to automate repetitive actions when installing a new dependency by typing:
make install github.com/stretchr/testify
And find a way to get the github.com/stretchr/testify
parameter without having to use the heavy parameter name-value declaration FOO=bar
(=> make install DEP=github.com/stretchr/testify
) generally suggested.
So, following this answer, I tried this:
install %:
go get $*
godep save ./...
git add Godeps vendor
git commit -m "godep: add $*"
but unsuccessfully: it runs go get
without any param and git commit -m "godep: add"
.
Trials
1 - When I do that:
install %:
echo $*
I see my "github.com/stretchr/testify".
2 - When I do that:
install %:
go get ${*}
it loops twice and first run go get
without any param, then runs go get github.com/stretchr/testify
(as wished).
It looks like ${*}
represents an "array" of params parsing characters groups after the target, the first one being the space between install
and github.com/stretchr/testify
and the second one being github.com/stretchr/testify
.