Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Improve our Makefile #95

Merged
merged 4 commits into from
May 17, 2019
Merged

Improve our Makefile #95

merged 4 commits into from
May 17, 2019

Conversation

juliogreff
Copy link
Contributor

Now that a Makefile was introduced, I tried to use it and it just didn't work at all for what I wanted to do. I made some changes that fixed the broken things, and made some non-broken things that weren't possible possible.

Using variables like $SHIPPER_IMAGE instead of $(SHIPPER_IMAGE) causes
errors like this:

	/bin/sh: HIPPER_IMAGE: command not found

It appears make interpolates variables like $(THIS) instead of like $THIS.
First of all, "shipper" is not a phony target [1]: it actually generates
a binary called "shipper". I suppose it was declared as phony so `make
shipper` would always be executed, instead of bailing out with "make:
`shipper' is up to date."

If we declare our dependencies correctly, though, it'll always execute
if the dependencies are changed, which is most likely what we actually
want, so let's do that.

[1] https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
It's very useful to be able to override names of images and commands
executed by the Makefile during testing. I can have my own image
registry, put shipper in any namespace I want, and I can also teach it
to work with microk8s.kubectl without having to resort to symlinks :)
@juliogreff juliogreff requested review from osdrv, parhamdoustdar and a user May 14, 2019 08:45
osdrv
osdrv previously approved these changes May 14, 2019
Silly me, pkg/* doesn't actually go deeper than 1 level, pkg/**/* is
needed for that. Without it, modifying any files inside any directory in
pkg/ or vendor/ and then calling `make shipper` wouldn't actually result
in the task being executed.
@juliogreff juliogreff changed the title Improves our Makefile Improve our Makefile May 16, 2019
@juliogreff juliogreff requested a review from osdrv May 16, 2019 13:08
@osdrv osdrv merged commit 3584fd5 into master May 17, 2019
@juliogreff juliogreff deleted the jgreff/makefile branch September 30, 2019 10:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants