Refactor installation targets
authorDan Nicholson <dbn.lists@gmail.com>
Wed, 7 May 2008 14:48:29 +0000 (07:48 -0700)
committerDan Nicholson <dbn.lists@gmail.com>
Wed, 7 May 2008 14:48:29 +0000 (07:48 -0700)
Currently, there is a single path in src/mesa/Makefile to install that
has a few conditionals in it. This commit changes install to act like
default where we loop over $(DRIVER_DIRS), deciding what to do.

A new target, install-headers, has been broken out to accomodate
installing a standalone OSMesa where neither libGL or gl.pc are wanted.

src/mesa/Makefile

index 75683908625b95add363e9cc5c2ed6a9dc80f3eb..4d834dd15720548bf2842eb12209ce7b3071d3c4 100644 (file)
@@ -37,6 +37,19 @@ default: depend
          esac ; \
        done
 
+install: default
+       @for driver in $(DRIVER_DIRS) ; do \
+         case "$$driver" in \
+           osmesa) if [ "$(DRIVER_DIRS)" = osmesa ]; then \
+                     $(MAKE) install-headers install-osmesa || exit 1 ; \
+                   else \
+                     $(MAKE) install-osmesa || exit 1 ; \
+                   fi ;; \
+           dri)    $(MAKE) install-libgl install-dri || exit 1 ;; \
+           *)      $(MAKE) install-libgl || exit 1 ;; \
+         esac ; \
+       done
+
 
 ######################################################################
 # BeOS driver target
@@ -160,31 +173,25 @@ pcedit = sed \
 gl.pc: gl.pc.in
        $(pcedit) $< > $@
 
-install-libgl: gl.pc
+install-headers:
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GL
+       $(INSTALL) -m 644 $(TOP)/include/GL/*.h \
+               $(DESTDIR)$(INSTALL_DIR)/include/GL
+
+install-libgl: default gl.pc install-headers
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
        $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
-       $(INSTALL) -m 644 $(TOP)/include/GL/*.h $(DESTDIR)$(INSTALL_DIR)/include/GL
-       @if [ -e $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) ]; then \
-               $(INSTALL) $(TOP)/$(LIB_DIR)/libGL* \
-                       $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
-       fi
+       $(INSTALL) $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)* \
+               $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
        $(INSTALL) -m 644 gl.pc $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)/pkgconfig
 
-install-osmesa:
-       @if [ -e $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME) ]; then \
-               $(INSTALL) $(TOP)/$(LIB_DIR)/libOSMesa* \
-                       $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR); \
-       fi
-
-install-drivers:
-       @for target in $(DRIVER_DIRS); do \
-         case "$$target" in \
-           dri) (cd drivers/dri && $(MAKE) install) || exit 1 ;; \
-         esac; \
-       done
+install-osmesa: default
+       $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
+       $(INSTALL) $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)* \
+               $(DESTDIR)$(INSTALL_DIR)/$(LIB_DIR)
 
-install: default install-libgl install-osmesa install-drivers
+install-dri:
+       cd drivers/dri && $(MAKE) install
 
 ## NOT INSTALLED YET:
 ## $(INSTALL) -d $(DESTDIR)$(INSTALL_DIR)/include/GLES