build: introduce a dist target
PATCH 1/1 build: introduce a dist target
The install target doesn't honour $PREFIX. Introduce a dist target to make it easier to package the artifacts.
--- Makefile | 5 +++++ 1 file changed, 5 insertions(+)
Makefile +5 -0
@@ -1,6 +1,7 @@ MAKEFLAGS += -r ROOT := $(abspath $(CURDIR)) DESTDIR ?= $(ROOT)/dist +DISTDIR ?= $(ROOT)/dist PREFIX ?= $(ROOT) .PHONY: all
@@ -10,6 +11,10 @@ all: $(MAKE) -C $$D build; \ done +.PHONY: dist +dist: DESTDIR=$(DISTDIR)$(PREFIX) +dist: install + .PHONY: install install: @mkdir -p $(DESTDIR)
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 21 lines · Wei Liu
The install target doesn't honour $PREFIX. Introduce a dist target to make it easier to package the artifacts.
Signed-off-by Wei Liu <[email protected]>--- Makefile | 5 +++++ 1 file changed, 5 insertions(+)Makefile +1
-0@@ -1,6 +1,7 @@ MAKEFLAGS += -r ROOT := $(abspath $(CURDIR)) DESTDIR ?= $(ROOT)/dist +DISTDIR ?= $(ROOT)/dist PREFIX ?= $(ROOT) .PHONY: all
Makefile all: · line 16
Quoted 6 lines
Makefile +3
-0@@ -10,6 +11,10 @@ all: $(MAKE) -C $$D build; \ done +.PHONY: dist +dist: DESTDIR=$(DISTDIR)$(PREFIX) +dist: install
Thusfar, I have been following GNU coding standards.
I don't see any references to DISTDIR, and this usage if make dist is incompatible with the standard expectation.
FWIW, make dist seems incompatible with XTF at the moment, because of the embedded absolute paths needed in the written xl configuration files.
For XenServer, my RPM configuration is:
%{__make} %{?_smp_mflags} install DESTDIR=%{buildroot}/opt/%{name} PREFIX=/opt/%{name}
to get make install to put the content sensibly in the build root, and to generate files with correct absolute paths.
How are you intending to make use of this new make dist target?
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 25 lines · Andrew Cooper
Quoted 24 lines · Wei Liu
The install target doesn't honour $PREFIX. Introduce a dist target to make it easier to package the artifacts.
Signed-off-by Wei Liu <[email protected]>--- Makefile | 5 +++++ 1 file changed, 5 insertions(+)Makefile +1
-0@@ -1,6 +1,7 @@ MAKEFLAGS += -r ROOT := $(abspath $(CURDIR)) DESTDIR ?= $(ROOT)/dist +DISTDIR ?= $(ROOT)/dist PREFIX ?= $(ROOT) .PHONY: all@@ -10,6 +11,10 @@ all: $(MAKE) -C $$D build; \ done
Quoted 9 lines
Makefile all: · line 16
Quoted 3 lines
Makefile +3
-0+.PHONY: dist +dist: DESTDIR=$(DISTDIR)$(PREFIX) +dist: installThusfar, I have been following GNU coding standards.
I don't see any references to DISTDIR, and this usage if
make distis incompatible with the standard expectation.
There is dist target in GNU standard. I regard DISTDIR an internal variable. It's fine that the user doesn't set it.
Quoted 3 lines
FWIW,
make distseems incompatible with XTF at the moment, because of the embedded absolute paths needed in the written xl configuration files.
Exactly. There is hardcoded paths in guest config files.
Quoted 6 lines
For XenServer, my RPM configuration is:
%{__make} %{?_smp_mflags} install DESTDIR=%{buildroot}/opt/%{name} PREFIX=/opt/%{name}
/opt/%{name} appeared twice here and the DESTDIR and PREFIX need to be kept in sync.
I'm fine with this too. Don't feel I want to argue one way or another.
Quoted 5 lines
to get
make installto put the content sensibly in the build root, and to generate files with correct absolute paths.How are you intending to make use of this new
make disttarget?
More or less like what you do for XenServer -- I suppose you just package buildroot and send that to the test host and install the artifacts.
Wei.
Quoted 2 lines
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 43 lines · Wei Liu
Quoted 25 lines · Andrew Cooper
Quoted 24 lines · Wei Liu
The install target doesn't honour $PREFIX. Introduce a dist target to make it easier to package the artifacts.
Signed-off-by Wei Liu <[email protected]>--- Makefile | 5 +++++ 1 file changed, 5 insertions(+)Makefile +1
-0@@ -1,6 +1,7 @@ MAKEFLAGS += -r ROOT := $(abspath $(CURDIR)) DESTDIR ?= $(ROOT)/dist +DISTDIR ?= $(ROOT)/dist PREFIX ?= $(ROOT) .PHONY: all@@ -10,6 +11,10 @@ all: $(MAKE) -C $$D build; \ doneQuoted 8 lines
Makefile all: · line 16
Quoted 3 lines
Makefile +3
-0+.PHONY: dist +dist: DESTDIR=$(DISTDIR)$(PREFIX) +dist: installThusfar, I have been following GNU coding standards.
I don't see any references to DISTDIR, and this usage if
make distis incompatible with the standard expectation.There is dist target in GNU standard. I regard DISTDIR an internal variable. It's fine that the user doesn't set it.
Quoted 3 lines
FWIW,
make distseems incompatible with XTF at the moment, because of the embedded absolute paths needed in the written xl configuration files.Exactly. There is hardcoded paths in guest config files.
Quoted 1 line
Quoted 8 lines
Quoted 4 lines
For XenServer, my RPM configuration is:
%{__make} %{?_smp_mflags} install DESTDIR=%{buildroot}/opt/%{name} PREFIX=/opt/%{name}
/opt/%{name} appeared twice here and the DESTDIR and PREFIX need to be kept in sync.
I'm fine with this too. Don't feel I want to argue one way or another.
Hmm, re-reading
https://www.gnu.org/prep/standards/html_node/DESTDIR.html I may have got the usage of DESTDIR wrong.
It looks like DESTDIR is supposed to be what you are using DISTDIR for.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH 1/1 Correct the usage of $(DESTDIR) and $(prefix)
In reply to Wei LiuThe GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for prefix to then be added to the path. This is not how XTF previously behaved.
Replace $(PREFIX) with its more common form $(prefix), and rearange $(DESTDIR) and $(prefix) to match expectation.
---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
--- Makefile | 15 ++++++++++----- build/gen.mk | 22 +++++++++++++++------- 2 files changed, 25 insertions(+), 12 deletions(-)
Makefile +10 -5
@@ -2,9 +2,14 @@ MAKEFLAGS += -r ROOT := $(abspath $(CURDIR)) export ROOT -DESTDIR ?= $(ROOT)/dist -PREFIX ?= $(ROOT) -export DESTDIR PREFIX +# $(prefix) defaults to $(ROOT) so development and testing can be done +# straight out of the working tree +prefix ?= $(ROOT) +DESTDIR ?= + +# Provide $(DEST) as the install root +DEST := $(DESTDIR)$(prefix) +export DEST DESTDIR prefix # Programs used CC ?= $(CROSS_COMPILE)gcc
@@ -27,8 +32,8 @@ all: .PHONY: install install: - @mkdir -p $(DESTDIR) - $(INSTALL_PROGRAM) -p xtf-runner $(DESTDIR) + @mkdir -p $(DEST) + $(INSTALL_PROGRAM) -p xtf-runner $(DEST) @set -e; for D in $(wildcard tests/*); do \ [ ! -e $$D/Makefile ] && continue; \ $(MAKE) -C $$D install; \
build/gen.mk +15 -7
@@ -21,6 +21,14 @@ ifneq ($(filter-out $(ALL_CATEGORIES),$(CATEGORY)),) $(error Unrecognised category '$(filter-out $(ALL_CATEGORIES),$(CATEGORY))') endif +ifeq ($(filter /%,$(prefix)),) +$(error $$(prefix) must be absolute, not '$(prefix)') +endif + +ifeq ($(filter /%,$(DEST)),) +$(error $$(DEST) must be absolute, not '$(DEST)') +endif + .PHONY: build build: $(foreach env,$(TEST-ENVS),test-$(env)-$(NAME) test-$(env)-$(NAME).cfg) build: test-info.json
@@ -31,8 +39,8 @@ test-info.json: $(ROOT)/build/mkinfo.py FORCE .PHONY: install install-each-env install: install-each-env test-info.json - @mkdir -p $(DESTDIR)/tests/$(NAME) - $(INSTALL_DATA) -p test-info.json $(DESTDIR)/tests/$(NAME) + @mkdir -p $(DEST)/tests/$(NAME) + $(INSTALL_DATA) -p test-info.json $(DEST)/tests/$(NAME) define PERENV_build
@@ -54,7 +62,7 @@ test-$(1)-$(NAME).cfg: $$(cfg-$(1)) FORCE @{ cat $$< $(TEST-EXTRA-CFG) ;} | \ sed -e "s/@@NAME@@/$$(NAME)/g" \ -e "s/@@ENV@@/$(1)/g" \ - -e "s!@@PREFIX@@!$$(PREFIX)!g" \ + -e "s!@@PREFIX@@!$$(prefix)!g" \ > [email protected] @if ! cmp -s $$@ [email protected]; then mv -f [email protected] $$@; else rm -f [email protected]; fi
@@ -63,12 +71,12 @@ test-$(1)-$(NAME).cfg: $$(cfg-$(1)) FORCE .PHONY: install-$(1) install-$(1).cfg install-$(1): test-$(1)-$(NAME) - @mkdir -p $(DESTDIR)/tests/$(NAME) - $(INSTALL_PROGRAM) -p $$< $(DESTDIR)/tests/$(NAME) + @mkdir -p $(DEST)/tests/$(NAME) + $(INSTALL_PROGRAM) -p $$< $(DEST)/tests/$(NAME) install-$(1).cfg: test-$(1)-$(NAME).cfg - @mkdir -p $(DESTDIR)/tests/$(NAME) - $(INSTALL_DATA) -p $$< $(DESTDIR)/tests/$(NAME) + @mkdir -p $(DEST)/tests/$(NAME) + $(INSTALL_DATA) -p $$< $(DEST)/tests/$(NAME) install-each-env: install-$(1) install-$(1).cfg
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)
Quoted 9 lines · Andrew Cooper
The GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for prefix to then be added to the path. This is not how XTF previously behaved.
Replace $(PREFIX) with its more common form $(prefix), and rearange $(DESTDIR) and $(prefix) to match expectation.
Reported-by Wei Liu <[email protected]>Signed-off-by Andrew Cooper <[email protected]>
The conclusion in the commit message is correct. The supplied patch conforms to that.
Signature · 1 line
Doug Goldstein
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)
In reply to Andrew CooperQuoted 5 lines · Andrew Cooper
The GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for prefix to then be added to the path. This is not how XTF previously behaved.
Replace $(PREFIX) with its more common form $(prefix), and rearange $(DESTDIR)
"rearrange"
Quoted 3 lines
and $(prefix) to match expectation.
Reported-by Wei Liu <[email protected]>
Space after colon.
The changes look fine to me.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)
In reply to Andrew CooperAndrew Cooper writes ("[PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)"):
Quoted 6 lines
The GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for prefix to then be added to the path. This is not how XTF previously behaved.
Replace $(PREFIX) with its more common form $(prefix), and rearange $(DESTDIR) and $(prefix) to match expectation.
...
Quoted 6 lines
Makefile +3
-3-DESTDIR ?= $(ROOT)/dist -PREFIX ?= $(ROOT) -export DESTDIR PREFIX +# $(prefix) defaults to $(ROOT) so development and testing can be done +# straight out of the working tree +prefix ?= $(ROOT)
...
Quoted 1 line
+DEST := $(DESTDIR)$(prefix)
...
Makefile all: · line 36
Quoted 4 lines
Makefile +2
-2- @mkdir -p $(DESTDIR) - $(INSTALL_PROGRAM) -p xtf-runner $(DESTDIR) + @mkdir -p $(DEST) + $(INSTALL_PROGRAM) -p xtf-runner $(DEST)
The effect of this is that
make prefix=/usr
will create
/usr/xtf-runner
/usr/tests/*/test-info.json
which is not how things would normally be expected work.
I think to make this work right, you have to do something like
ifeq ($prefix,)
bindir=$(ROOT)
xtflibdir=$(ROOT)
else
bindir=$(prefix)/bin
xtflibdir=$(prefix)/lib/xtf
endif
xtftestsdir=$(xtflibdir)/tests
...
$(INSTALL_PROGRAM) -p xtf-runner $(DESTDIR)/$(bindir)
...
$(INSTALL_DATA) -p test-info.json $(DESTDIR)/$(xtftestsdir)/$(NAME)Also it would be more conventional to use $(INSTALL) -d or $(INSTALL_DIR) rather than mkdir.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)
Quoted 17 lines · Ian Jackson
Andrew Cooper writes ("[PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)"):
Quoted 6 lines
The GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for prefix to then be added to the path. This is not how XTF previously behaved.
Replace $(PREFIX) with its more common form $(prefix), and rearange $(DESTDIR) and $(prefix) to match expectation.
...
Quoted 6 lines
Makefile +3
-3-DESTDIR ?= $(ROOT)/dist -PREFIX ?= $(ROOT) -export DESTDIR PREFIX +# $(prefix) defaults to $(ROOT) so development and testing can be done +# straight out of the working tree +prefix ?= $(ROOT)...
Quoted 1 line
+DEST := $(DESTDIR)$(prefix)
...
Quoted 10 lines
Makefile all: · line 36
Quoted 4 lines
Makefile +2
-2- @mkdir -p $(DESTDIR) - $(INSTALL_PROGRAM) -p xtf-runner $(DESTDIR) + @mkdir -p $(DEST) + $(INSTALL_PROGRAM) -p xtf-runner $(DEST)The effect of this is that
make prefix=/usr
will create
/usr/xtf-runner
/usr/tests/*/test-info.json
which is not how things would normally be expected work.
XTF doesn't match any standard installable package. It is some configuration files and a load of microkernels which are not system executables.
I build it with prefix=/opt/xtf as that is the only plausible place for the results to live, per the FHS. It could certainly be argued that it should insert its own xtf/ directory rather than relying on prefix to pass it.
Quoted 15 lines
I think to make this work right, you have to do something like
ifeq ($prefix,) bindir=$(ROOT) xtflibdir=$(ROOT) else bindir=$(prefix)/bin xtflibdir=$(prefix)/lib/xtf endif xtftestsdir=$(xtflibdir)/tests ... $(INSTALL_PROGRAM) -p xtf-runner $(DESTDIR)/$(bindir) ... $(INSTALL_DATA) -p test-info.json $(DESTDIR)/$(xtftestsdir)/$(NAME)
xtf-runner expects to find tests/ in the same directory it resides in, because otherwise there is no sensible way to find it.
Quoted 3 lines
Also it would be more conventional to use $(INSTALL) -d or $(INSTALL_DIR) rather than mkdir.
I will make this change.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)
Andrew Cooper writes ("Re: [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)"):
Quoted 3 lines
XTF doesn't match any standard installable package. It is some configuration files and a load of microkernels which are not system executables.
The question is what
really make install prefix=/usr
should do. That's something that the standard Makefile targets suggest ought to do something sane.
From what you write it probably ought to dump its stuff in
/usr/lib/xtf/<whatever>
?
Quoted 4 lines
I build it with prefix=/opt/xtf as that is the only plausible place for the results to live, per the FHS. It could certainly be argued that it should insert its own xtf/ directory rather than relying on prefix to pass it.
It's conventional for /opt/foo to contain /opt/foo/bin, /opt/foo/man, and so on.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
PATCH v3 1/1 Correct the usage of $(DESTDIR) and $(PREFIX)
In reply to Wei LiuThe GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for $(PREFIX) to then be added to the path. This is not how XTF previously behaved.
XTF is not a typical package, and doesn't meet the usual semantics; it expects to arrange all files in a single directory. Drop the use of $(PREFIX) entirely (to avoid the expectation that it behaves as $(prefix) usually behaves) and introduce $(xtfdir) instead.
$(DESTDIR) now works as intended for staged installes, and $(xtfdir) is the single selected directy containing all installed content, typically expected to be /opt/xtf or similar.
The intended way to install XTF now:
$ make install DESTDIR=/path/to/staging/area xtfdir=/opt/xtf
---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
v3:
* Drop $(PREFIX) entirely, as the semantics don't match. Use $(xtfdir) instead to make it obvious that it is different.
v2:
* Add an explicit subdirectory, to avoid prefix=/usr putting a number of files and directories straight in /usr
--- Makefile | 23 +++++++++++++++++++---- build/gen.mk | 14 +++++++------- config/default-hvm.cfg.in | 2 +- config/default-pv.cfg.in | 2 +- docs/introduction.dox | 2 +- docs/mainpage.dox | 4 ++-- 6 files changed, 31 insertions(+), 16 deletions(-)
Makefile +19 -4
@@ -2,9 +2,24 @@ MAKEFLAGS += -r ROOT := $(abspath $(CURDIR)) export ROOT +# $(xtfdir) defaults to $(ROOT) so development and testing can be done +# straight out of the working tree. +xtfdir ?= $(ROOT) DESTDIR ?= $(ROOT)/dist -PREFIX ?= $(ROOT) -export DESTDIR PREFIX + +ifeq ($(filter /%,$(xtfdir)),) +$(error $$(xtfdir) must be absolute, not '$(xtfdir)') +endif + +ifneq ($(DESTDIR),) +ifeq ($(filter /%,$(DESTDIR)),) +$(error $$(DESTDIR) must be absolute, not '$(DESTDIR)') +endif +endif + +xtftestdir := $(xtfdir)/tests + +export DESTDIR xtfdir xtftestdir # Programs used CC ?= $(CROSS_COMPILE)gcc
@@ -28,8 +43,8 @@ all: .PHONY: install install: - @$(INSTALL_DIR) $(DESTDIR) - $(INSTALL_PROGRAM) xtf-runner $(DESTDIR) + @$(INSTALL_DIR) $(DESTDIR)$(xtfdir) + $(INSTALL_PROGRAM) xtf-runner $(DESTDIR)$(xtfdir) @set -e; for D in $(wildcard tests/*); do \ [ ! -e $$D/Makefile ] && continue; \ $(MAKE) -C $$D install; \
build/gen.mk +7 -7
@@ -31,8 +31,8 @@ test-info.json: $(ROOT)/build/mkinfo.py FORCE .PHONY: install install-each-env install: install-each-env test-info.json - @$(INSTALL_DIR) $(DESTDIR)/tests/$(NAME) - $(INSTALL_DATA) test-info.json $(DESTDIR)/tests/$(NAME) + @$(INSTALL_DIR) $(DESTDIR)$(xtftestdir)/$(NAME) + $(INSTALL_DATA) test-info.json $(DESTDIR)$(xtftestdir)/$(NAME) define PERENV_build
@@ -54,7 +54,7 @@ test-$(1)-$(NAME).cfg: $$(cfg-$(1)) FORCE @{ cat $$< $(TEST-EXTRA-CFG) ;} | \ sed -e "s/@@NAME@@/$$(NAME)/g" \ -e "s/@@ENV@@/$(1)/g" \ - -e "s!@@PREFIX@@!$$(PREFIX)!g" \ + -e "s!@@XTFDIR@@!$$(xtfdir)!g" \ > [email protected] @if ! cmp -s $$@ [email protected]; then mv -f [email protected] $$@; else rm -f [email protected]; fi
@@ -63,12 +63,12 @@ test-$(1)-$(NAME).cfg: $$(cfg-$(1)) FORCE .PHONY: install-$(1) install-$(1).cfg install-$(1): test-$(1)-$(NAME) - @$(INSTALL_DIR) $(DESTDIR)/tests/$(NAME) - $(INSTALL_PROGRAM) $$< $(DESTDIR)/tests/$(NAME) + @$(INSTALL_DIR) $(DESTDIR)$(xtftestdir)/$(NAME) + $(INSTALL_PROGRAM) $$< $(DESTDIR)$(xtftestdir)/$(NAME) install-$(1).cfg: test-$(1)-$(NAME).cfg - @$(INSTALL_DIR) $(DESTDIR)/tests/$(NAME) - $(INSTALL_DATA) $$< $(DESTDIR)/tests/$(NAME) + @$(INSTALL_DIR) $(DESTDIR)$(xtftestdir)/$(NAME) + $(INSTALL_DATA) $$< $(DESTDIR)$(xtftestdir)/$(NAME) install-each-env: install-$(1) install-$(1).cfg
config/default-hvm.cfg.in +1 -1
@@ -1,7 +1,7 @@ name="test-@@ENV@@-@@NAME@@" builder="hvm" memory=128 -firmware_override="@@PREFIX@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@" +firmware_override="@@XTFDIR@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@" # The framework doesn't reboot. A reboot signal is almost certainly a triple # fault instead. Prevent it turning into a runaway domain.
config/default-pv.cfg.in +1 -1
@@ -1,4 +1,4 @@ name="test-@@ENV@@-@@NAME@@" loader="generic" memory=128 -kernel="@@PREFIX@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@" +kernel="@@XTFDIR@@/tests/@@NAME@@/test-@@ENV@@-@@NAME@@"
docs/introduction.dox +1 -1
@@ -131,7 +131,7 @@ If XTF in being built in dom0, all paths should be set up to run correctly. If XTF is built elsewhere, it should be installed: - $ make install PREFIX=/path DESTDIR=/path + $ make install xtfdir=/path DESTDIR=/path with paths appropriate for the system under test.
docs/mainpage.dox +2 -2
@@ -62,9 +62,9 @@ To run tests on a Xen host: (see @ref errata first) - For the paths of binaries, `xl` accepts either an absolute path, or certain relative paths (`/etc/xen/` or `$CWD` for `kernel=`, `$libdir/xen/boot` for - `firmware_override=`). The default `PREFIX=` is configured correctly for + `firmware_override=`). The default `xtfdir=` is configured correctly for running the tests out of the build working tree. If the tests are running - elsewhere, use `make install DESTDIR=$X PREFIX=$Y` to configure absolute + elsewhere, use `make install DESTDIR=$X xtfdir=$Y` to configure absolute paths appropriately for the test system.
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Re: [XTF PATCH v3] Correct the usage of $(DESTDIR) and $(PREFIX)
Quoted 13 lines · Andrew Cooper
The GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for $(PREFIX) to then be added to the path. This is not how XTF previously behaved.
XTF is not a typical package, and doesn't meet the usual semantics; it expects to arrange all files in a single directory. Drop the use of $(PREFIX) entirely (to avoid the expectation that it behaves as $(prefix) usually behaves) and introduce $(xtfdir) instead.
$(DESTDIR) now works as intended for staged installes, and $(xtfdir) is the single selected directy containing all installed content, typically expected to be
/opt/xtfor similar.
Quoted 6 lines
The intended way to install XTF now:
$ make install DESTDIR=/path/to/staging/area xtfdir=/opt/xtfReported-by Wei Liu <[email protected]>Signed-off-by Andrew Cooper <[email protected]>
This code does what the commit message says:
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [XTF PATCH v3] Correct the usage of $(DESTDIR) and $(PREFIX)
In reply to Andrew CooperAndrew Cooper writes ("[XTF PATCH v3] Correct the usage of $(DESTDIR) and $(PREFIX)"):
Quoted 4 lines
The GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for $(PREFIX) to then be added to the path. This is not how XTF previously behaved.
Quoted 8 lines
XTF is not a typical package, and doesn't meet the usual semantics; it expects to arrange all files in a single directory. Drop the use of $(PREFIX) entirely (to avoid the expectation that it behaves as $(prefix) usually behaves) and introduce $(xtfdir) instead.
$(DESTDIR) now works as intended for staged installes, and $(xtfdir) is the single selected directy containing all installed content, typically expected to be
/opt/xtfor similar.
The semantics you describe are sensible but I want to quibble with your example xtfdir value. It is conventional for areas in /opt to contain the usual subdirs.
http://www.pathname.com/fhs/pub/fhs-2.3.html#OPTADDONAPPLICATIONSOFTWAREPACKAGES
Quoted 2 lines
The intended way to install XTF now:
$ make install DESTDIR=/path/to/staging/area xtfdir=/opt/xtf
So I think you should provide to a different example. How about /local/scratch/xtf ?
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [XTF PATCH v3] Correct the usage of $(DESTDIR) and $(PREFIX)
Quoted 17 lines · Ian Jackson
Andrew Cooper writes ("[XTF PATCH v3] Correct the usage of $(DESTDIR) and $(PREFIX)"):
Quoted 4 lines
The GNU coding standards expect $(DESTDIR) to be the root of everything installed, and for $(PREFIX) to then be added to the path. This is not how XTF previously behaved.
Quoted 8 lines
XTF is not a typical package, and doesn't meet the usual semantics; it expects to arrange all files in a single directory. Drop the use of $(PREFIX) entirely (to avoid the expectation that it behaves as $(prefix) usually behaves) and introduce $(xtfdir) instead.
$(DESTDIR) now works as intended for staged installes, and $(xtfdir) is the single selected directy containing all installed content, typically expected to be
/opt/xtfor similar.The semantics you describe are sensible but I want to quibble with your example xtfdir value. It is conventional for areas in /opt to contain the usual subdirs.
Quoted 6 lines
http://www.pathname.com/fhs/pub/fhs-2.3.html#OPTADDONAPPLICATIONSOFTWAREPACKAGES
Quoted 2 lines
The intended way to install XTF now:
$ make install DESTDIR=/path/to/staging/area xtfdir=/opt/xtfSo I think you should provide to a different example. How about /local/scratch/xtf ?
Fine - I will adjust on commit.
~Andrew
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel