From c16cd856651c5d8fde6bfad41de6f24acd811e46 Mon Sep 17 00:00:00 2001 From: Charles Wilson Date: Thu, 29 Oct 2009 21:53:47 +0000 Subject: Honor DESTDIR for winsup/mingw and winsup/w32api --- winsup/mingw/mingwex/Makefile.in | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'winsup/mingw/mingwex/Makefile.in') diff --git a/winsup/mingw/mingwex/Makefile.in b/winsup/mingw/mingwex/Makefile.in index 2ccffe1ab..a495d5269 100644 --- a/winsup/mingw/mingwex/Makefile.in +++ b/winsup/mingw/mingwex/Makefile.in @@ -255,10 +255,22 @@ info-html: install-info: info -install: all - $(mkinstalldirs) $(inst_libdir) +need-DESTDIR-compatibility = prefix libdir +.PHONY: $(need-DESTDIR-compatibility) fail-DESTDIR-compatibility + +$(need-DESTDIR-compatibility): + @test -z "$(DESTDIR)" || case "$($@)" in ?:*) \ + $(MAKE) --no-print-directory reject="$@" fail-DESTDIR-compatibility ;; \ + esac + +fail-DESTDIR-compatibility: + $(error DESTDIR is not supported when $(reject) contains Win32 path `$($(reject))'; \ + try `make install $(reject)=$(shell echo '$($(reject))' | sed s,:,:$(DESTDIR),) ...' instead) + +install: all $(need-DESTDIR-compatibility) + $(mkinstalldirs) $(DESTDIR)$(inst_libdir) for i in $(LIBS); do \ - $(INSTALL_DATA) $$i $(inst_libdir)/$$i ; \ + $(INSTALL_DATA) $$i $(DESTDIR)$(inst_libdir)/$$i ; \ done clean: -- cgit v1.2.3