Message ID | 20170517200025.12258-1-konrad.wilk@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
>>> On 17.05.17 at 22:00, <konrad.wilk@oracle.com> wrote: > --- a/xen/test/Makefile > +++ b/xen/test/Makefile > @@ -5,3 +5,7 @@ tests: > .PHONY: clean > clean:: > $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch clean > + > +.PHONY: install > +install: > + $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch install If we really want to provide a standard way to install tests (which I'm not sure about, after all these are tests and hence play no role during an actual installation), shouldn't this then at least be accompanied by a matching uninstall rule? Also I think if more stuff is to be added here, this Makefile could do with some abstraction (SUBDIR or subdir-y instead of explicitly naming the sole current subdirectory) to avoid later additions needing to touch all this again. Jan
Konrad Rzeszutek Wilk writes ("[PATCH] livepatch/Makefile: Add 'install' stanza"): > So that you can do: > > DESTDIR=`pwd`/dist/xenlptinstall/usr/lib/debug > mkdir -p $DESTDIR > BASEDIR=`pwd`/xen XEN_ROOT=`pwd` make -C xen/test -f `pwd`/xen/Rules.mk install Looking at our other DESTDIR settings, they do not include things like `/usr/lib/debug'. Normally DESTDIR seems to be set to `/' or `$DISTDIR/install' aka `dist/install/'. How about an interface where that make dist-tests installs things in dists/tests by default, eg dists/tests/usr/lib/debug/some-livepath-thing ? This would probably be achieved by having dist-tests set DESTDIR=$(DISTDIR)/tests, eg dist-tests: DESTDIR=$(DISTDIR)/tests dist-tests: install-tests Then `make install-tests' should default DESTDIR to / and put things in /usr/lib/debug. Jan Beulich writes ("Re: [Xen-devel] [PATCH] livepatch/Makefile: Add 'install' stanza"): > If we really want to provide a standard way to install tests (which > I'm not sure about, after all these are tests and hence play no > role during an actual installation), We need a way to _ship_ tests as a formal deliverable from the build system. Consumers of tests (that can be run out of tree, like these) should not be expected to fish them out of the build tree. In our existing build system, we ship things with `make dist'. This ships them into dist/ by using the install targets. I don't see any reason to diverge from this for tests. It would be silly to make special snowflake machinery to ship tests simply to avoid having a mostly-unused `make install-tests'. (Obviously `make install' ought not to run `make install-tests' by default.) > shouldn't this then at least be > accompanied by a matching uninstall rule? I don't think that is necessary. > Also I think if more stuff is to be added here, this Makefile could > do with some abstraction (SUBDIR or subdir-y instead of > explicitly naming the sole current subdirectory) to avoid later > additions needing to touch all this again. This is a sensible suggestion. Ian.
diff --git a/xen/test/Makefile b/xen/test/Makefile index d91b319..410895b 100644 --- a/xen/test/Makefile +++ b/xen/test/Makefile @@ -5,3 +5,7 @@ tests: .PHONY: clean clean:: $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch clean + +.PHONY: install +install: + $(MAKE) -f $(BASEDIR)/Rules.mk -C livepatch install
So that you can do: DESTDIR=`pwd`/dist/xenlptinstall/usr/lib/debug mkdir -p $DESTDIR BASEDIR=`pwd`/xen XEN_ROOT=`pwd` make -C xen/test -f `pwd`/xen/Rules.mk install or such. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> --- xen/test/Makefile | 4 ++++ 1 file changed, 4 insertions(+)