Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Makefile: New file implementing make install #106

Merged
merged 1 commit into from
Sep 23, 2019

Conversation

cgwalters
Copy link
Member

See https://github.com/cgwalters/build-api

With this for example, we can just have the Fedora spec file do
make install DESTDIR=$RPM_BUILD_ROOT just like everything else;
helping to ensure that as much logic as possible remains upstream.

Mainly I want this for hacking so I can just
make install DESTDIR=/srv/walters/fcos/overrides/rootfs
without building an RPM or copying files manually.

Copy link
Contributor

@ajeddeloh ajeddeloh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 I like this idea.

install -D -t $(DESTDIR)/usr/lib/dracut/modules.d/$${bn} $$x/*; \
done
install -D -t $(DESTDIR)/usr/lib/systemd/system systemd/*
install -D -t $(DESTDIR)/etc/grub.d grub/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still be carrying this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #91
(So currently yes)

Makefile Outdated
@@ -0,0 +1,7 @@
install:
Copy link
Member

@jlebon jlebon Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: if there's no build step, I tend to add something like:

.PHONY: all
all:
	@echo "No build step."

at the top so that (1) a make all still Just Works in an automated context, and (2) a pure make won't actually do a make install.

Let's maybe also add a .PHONY for install?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, excellent feedback! Updated ⬇️

@dustymabe
Copy link
Member

dustymabe commented Sep 18, 2019

should we require that someone provide DESTDIR so that we don't accidentally pollute a users system?

ifndef DESTDIR
$(error DESTDIR is not set)
endif

@cgwalters
Copy link
Member Author

cgwalters commented Sep 18, 2019

should we require that someone provide DESTDIR so that we don't accidentally pollute a users system?

No, because that'd break sudo make install, which is part of the "automake makefile standard" since forever. (That said, sudo make install is actually a bad idea, and is why I actually use https://github.com/cgwalters/homegit/blob/3f06d49c1962885982ac27f49eb896ee5433131b/dot-config/fish/config.fish#L8 )

@dustymabe
Copy link
Member

one remaining comment: #106 (comment)

See https://github.com/cgwalters/build-api

With this for example, we can just have the Fedora spec file do
`make install DESTDIR=$RPM_BUILD_ROOT` just like everything else;
helping to ensure that as much logic as possible remains upstream.

Mainly I want this for hacking so I can just
`make install DESTDIR=/srv/walters/fcos/overrides/rootfs`
without building an RPM or copying files manually.
@dustymabe
Copy link
Member

will let @jlebon do final review/merge

@jlebon jlebon merged commit f06c020 into coreos:master Sep 23, 2019
cgwalters added a commit to cgwalters/ignition that referenced this pull request Sep 23, 2019
Following coreos/ignition-dracut#106
add a default `make install` rule that honors `DESTDIR`.  Main
motivation is hacking on ignition in a unified way with ostree,
ignition-dracut and other projects using coreos-assembler.
cgwalters added a commit to cgwalters/ignition that referenced this pull request Sep 24, 2019
Following coreos/ignition-dracut#106
add a default `make install` rule that honors `DESTDIR`.  Main
motivation is hacking on ignition in a unified way with ostree,
ignition-dracut and other projects using coreos-assembler.
cgwalters added a commit to cgwalters/ignition that referenced this pull request Sep 24, 2019
Following coreos/ignition-dracut#106
add a default `make install` rule that honors `DESTDIR`.  Main
motivation is hacking on ignition in a unified way with ostree,
ignition-dracut and other projects using coreos-assembler.
jlebon pushed a commit to jlebon/ignition that referenced this pull request Mar 16, 2020
Following coreos/ignition-dracut#106
add a default `make install` rule that honors `DESTDIR`.  Main
motivation is hacking on ignition in a unified way with ostree,
ignition-dracut and other projects using coreos-assembler.

(Backport of coreos#858)
cgwalters added a commit to cgwalters/coreos-installer that referenced this pull request Apr 22, 2020
Same rationale as coreos/ignition-dracut#106

See https://github.com/cgwalters/build-api

With this for example, we can just have the RHEL spec file do
`make install DESTDIR=$RPM_BUILD_ROOT` just like everything else;
helping to ensure that as much logic as possible remains upstream.
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.

4 participants