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

Re: [Xen-devel] [PATCH XTF] Correct the usage of $(DESTDIR) and $(prefix)



Andrew Cooper writes ("[PATCH XTF] Correct the usage of $(DESTDIR) and 
$(prefix)"):
> 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.
...
> -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)
...
> +DEST := $(DESTDIR)$(prefix)
...
> -     @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
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®.