diff options
Diffstat (limited to 'winsup/w32api/lib/ddk/Makefile.in')
-rw-r--r-- | winsup/w32api/lib/ddk/Makefile.in | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/winsup/w32api/lib/ddk/Makefile.in b/winsup/w32api/lib/ddk/Makefile.in index 80b148c2a..d6040f3cc 100644 --- a/winsup/w32api/lib/ddk/Makefile.in +++ b/winsup/w32api/lib/ddk/Makefile.in @@ -141,35 +141,47 @@ lib%.a: %.o $(AR) rc $@ $*.o $(RANLIB) $@ +need-DESTDIR-compatibility = prefix libdir includedir +.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 headers and libraries in a target specified directory. install: install-libraries install-headers -install-libraries: all - $(mkinstalldirs) $(inst_libdir) +install-libraries: 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 -install-headers: - $(mkinstalldirs) $(inst_includedir) +install-headers: $(need-DESTDIR-compatibility) + $(mkinstalldirs) $(DESTDIR)$(inst_includedir) for i in $(HEADERS); do \ - $(INSTALL_DATA) $(srcdir)/../../include/ddk/$$i $(inst_includedir)/$$i ; \ + $(INSTALL_DATA) $(srcdir)/../../include/ddk/$$i $(DESTDIR)$(inst_includedir)/$$i ; \ done # uninstall headers and libraries from a target specified directory uninstall: uninstall-libraries uninstall-headers -uninstall-libraries: +uninstall-libraries: $(need-DESTDIR-compatibility) @for i in $(LIBS); do \ - rm -f $(inst_libdir)/$$i ; \ + rm -f $(DESTDIR)$(inst_libdir)/$$i ; \ done - rmdir $(inst_libdir) + rmdir $(DESTDIR)$(inst_libdir) -uninstall-headers: +uninstall-headers: $(need-DESTDIR-compatibility) @for i in $(HEADERS); do \ - rm -r $(inst_includedir)/$$i ; \ + rm -r $(DESTDIR)$(inst_includedir)/$$i ; \ done - rmdir $(inst_includedir) + rmdir $(DESTDIR)$(inst_includedir) dist: |