Emil Velikov | bbae65e | 2014-03-02 20:59:39 +0000 | [diff] [blame] | 1 | # Provide compatibility with scripts for the old Mesa build system for |
| 2 | # a while by putting a link to the driver into /lib of the build tree. |
| 3 | |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 4 | if BUILD_SHARED |
Emil Velikov | 22c1335 | 2014-03-09 11:50:44 +0000 | [diff] [blame] | 5 | if HAVE_COMPAT_SYMLINKS |
Emil Velikov | 0b6157e | 2016-02-25 16:53:06 +0000 | [diff] [blame] | 6 | all-local : .install-gallium-links |
Emil Velikov | bbae65e | 2014-03-02 20:59:39 +0000 | [diff] [blame] | 7 | |
Emil Velikov | 0b6157e | 2016-02-25 16:53:06 +0000 | [diff] [blame] | 8 | .install-gallium-links : $(dri_LTLIBRARIES) $(egl_LTLIBRARIES) $(lib_LTLIBRARIES) |
Emil Velikov | bbae65e | 2014-03-02 20:59:39 +0000 | [diff] [blame] | 9 | $(AM_V_GEN)$(MKDIR_P) $(top_builddir)/$(LIB_DIR); \ |
| 10 | link_dir=$(top_builddir)/$(LIB_DIR)/gallium; \ |
| 11 | if test x$(egl_LTLIBRARIES) != x; then \ |
| 12 | link_dir=$(top_builddir)/$(LIB_DIR)/egl; \ |
| 13 | fi; \ |
| 14 | $(MKDIR_P) $$link_dir; \ |
Tim Rowley | aee9767 | 2016-04-13 15:06:45 -0500 | [diff] [blame] | 15 | file_list="$(dri_LTLIBRARIES:%.la=.libs/%.so)"; \ |
Eric Anholt | ec9ed1c | 2016-10-06 15:19:21 -0700 | [diff] [blame] | 16 | file_list="$$file_list$(egl_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)"; \ |
| 17 | file_list="$$file_list$(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)"; \ |
Emil Velikov | bbae65e | 2014-03-02 20:59:39 +0000 | [diff] [blame] | 18 | for f in $$file_list; do \ |
| 19 | if test -h .libs/$$f; then \ |
| 20 | cp -d $$f $$link_dir; \ |
| 21 | else \ |
| 22 | ln -f $$f $$link_dir; \ |
| 23 | fi; \ |
| 24 | done && touch $@ |
Emil Velikov | 22c1335 | 2014-03-09 11:50:44 +0000 | [diff] [blame] | 25 | endif |
Emil Velikov | 0b6157e | 2016-02-25 16:53:06 +0000 | [diff] [blame] | 26 | |
| 27 | clean-local: |
| 28 | for f in $(notdir $(dri_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)) \ |
| 29 | $(notdir $(egl_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)) \ |
| 30 | $(notdir $(lib_LTLIBRARIES:%.la=.libs/%.$(LIB_EXT)*)); do \ |
| 31 | echo $$f; \ |
| 32 | $(RM) $(top_builddir)/$(LIB_DIR)/gallium/$$f; \ |
| 33 | done; |
| 34 | rmdir $(top_builddir)/$(LIB_DIR)/gallium || true |
| 35 | $(RM) .install-gallium-links |
| 36 | |
Emil Velikov | 4d8267e | 2014-03-12 18:13:02 +0000 | [diff] [blame] | 37 | endif |