pmake installs fails with custom DESTDIR:
/tmp/elftoolchain-0.7.1# DESTDIR=/my/prefix pmake install install ===> common install -c -o root -g root -m 644 elfdefinitions.h /my/prefix/usr/include/elfdefinitions.h install: cannot create regular file '/my/prefix/usr/include/elfdefinitions.h': No such file or directory *** Error code 1 Stop. pmake[1]: stopped in /tmp/elftoolchain-0.7.1/common *** Error code 1 Stop. pmake: stopped in /tmp/elftoolchain-0.7.1
My Dockerfile:
FROM ubuntu:14.04 #----------------------------------------------------------------------------- # development tools RUN \ apt-get update && \ apt-get install --no-install-recommends -qyy \ autoconf \ automake \ build-essential \ ca-certificates \ clang \ cmake \ g++ \ gawk \ gdb \ gfortran \ git \ libtool \ make \ openssl \ pkg-config \ ssh \ subversion \ wget #----------------------------------------------------------------------------- # install fpm debian packager RUN \ cd /tmp/ && \ wget \ https://github.com/jordansissel/fpm/archive/v1.8.0.tar.gz \ -O fpm.tar.gz && \ tar xf fpm.tar.gz && \ cd fpm* && \ apt-get install ruby-dev -qyy && \ gem install fpm && \ cd /tmp/ && \ which fpm && \ fpm --version #----------------------------------------------------------------------------- # download elftools RUN cd /tmp/ && \ wget "https://downloads.sourceforge.net/project/elftoolchain/Sources/elftoolchain-0.7.1/elftoolchain-0.7.1.tar.bz2?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Felftoolchain%2Ffiles%2FSources%2Felftoolchain-0.7.1%2F&ts=1496851894&use_mirror=svwh" \ -O elftoolchain-0.7.1.tar.bz2 #----------------------------------------------------------------------------- # download the test tools package RUN cd /tmp/ && \ wget http://tetworks.opengroup.org/downloads/38/software/Sources/3.8/tet3.8-src.tar.gz -O \ tet3.8-src.tar.gz #----------------------------------------------------------------------------- # install dev dependancies RUN apt-get install --no-install-recommends -qyy \ bison \ bmake \ flex \ libarchive-dev \ libexpat1-dev \ m4 \ pmake \ python \ python-yaml \ sharutils \ zlib1g-dev #----------------------------------------------------------------------------- # build elftools RUN cd /tmp/ && \ tar xf elftool*.tar.bz2 && \ cd elftool* && \ tar xf /tmp/tet*.tar.gz -C test/tet && \ pmake #------------------------------------------------------------------------- # the pmake DESTDIR install doesn't work!!!!!!! #~RUN cd /tmp/elftool* && \ #~ mkdir -p /opt/knupath/usr/include && \ #~ pmake DESTDIR=/opt/knupath install
The make rules in /usr/share/mk/ expect that the DESTDIR hierarchy has been created aforehand, e.g. when a 'make installworld' is run in /usr/src.
This obviously won't work if a 'make install' is attemped without the hierarchy being in place, e.g., on GNU/Linux. A possible work-around could be to add a ".if make(install)" stanza to elftoolchain.{*}.mk which would create the relevant destination directories before doing the real install.