[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH XTF] build: introduce a dist target



On 20/07/16 14:10, Wei Liu wrote:
> On Wed, Jul 20, 2016 at 01:52:43PM +0100, Andrew Cooper wrote:
>> On 20/07/16 12:55, Wei Liu wrote:
>>> The install target doesn't honour $PREFIX. Introduce a dist target to
>>> make it easier to package the artifacts.
>>>
>>> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
>>> ---
>>>  Makefile | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 1a8099d..d625b90 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -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
>> 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.
>>
> There is dist target in GNU standard. I regard DISTDIR an internal
> variable. It's fine that the user doesn't set it.
>
>> FWIW, `make dist` seems 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.
>
>>
>> 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
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.