gallium: Improve recursive makefiles
authorJakob Bornecrantz <jakob@vmware.com>
Thu, 19 Feb 2009 23:50:26 +0000 (00:50 +0100)
committerJakob Bornecrantz <jakob@vmware.com>
Fri, 20 Feb 2009 11:25:55 +0000 (11:25 +0000)
src/gallium/Makefile
src/gallium/auxiliary/Makefile
src/gallium/drivers/Makefile
src/gallium/winsys/Makefile
src/gallium/winsys/drm/Makefile
src/gallium/winsys/drm/intel/Makefile
src/gallium/winsys/drm/nouveau/Makefile

index 875314f..79ca767 100644 (file)
@@ -1,26 +1,12 @@
+# src/gallium/Makefile
 TOP = ../..
 include $(TOP)/configs/current
 
-
 SUBDIRS = $(GALLIUM_DIRS)
-# Note winsys/ needs to be built after src/mesa
-
-
-default: subdirs
-
 
-subdirs:
+default install clean:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE)) || exit 1 ; \
+                       (cd $$dir && $(MAKE) $@) || exit 1; \
                fi \
        done
-
-
-clean:
-       rm -f `find . -name \*.[oa]`
-       rm -f `find . -name depend`
-
-
-# Dummy install target
-install:
index eaa0f2f..5446eb6 100644 (file)
@@ -1,20 +1,12 @@
+# src/gallium/auxiliary/Makefile
 TOP = ../../..
 include $(TOP)/configs/current
 
-
 SUBDIRS = $(GALLIUM_AUXILIARY_DIRS)
 
-
-default: subdirs
-
-
-subdirs:
+default install clean:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE)) || exit 1 ; \
+                       (cd $$dir && $(MAKE) $@) || exit 1; \
                fi \
        done
-
-
-clean:
-       rm -f `find . -name \*.[oa]`
index 6161cb6..9211a93 100644 (file)
@@ -1,20 +1,12 @@
+# src/gallium/drivers/Makefile
 TOP = ../../..
 include $(TOP)/configs/current
 
-
 SUBDIRS = $(GALLIUM_DRIVER_DIRS)
 
-
-default: subdirs
-
-
-subdirs:
+default install clean:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE)) || exit 1 ; \
+                       (cd $$dir && $(MAKE) $@) || exit 1; \
                fi \
        done
-
-
-clean:
-       rm -f `find . -name \*.[oa]`
index 2360a6a..bce5b3f 100644 (file)
@@ -1,24 +1,12 @@
+# src/gallium/winsys/Makefile
 TOP = ../../..
 include $(TOP)/configs/current
 
-
 SUBDIRS = $(GALLIUM_WINSYS_DIRS)
 
-
-default: subdirs
-
-
-subdirs:
+default install clean:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE)) || exit 1 ; \
+                       (cd $$dir && $(MAKE) $@) || exit 1; \
                fi \
        done
-
-
-clean:
-       rm -f `find . -name \*.[oa]`
-
-
-# Dummy install target
-install:
index a84fcd8..fee0191 100644 (file)
@@ -1,38 +1,12 @@
-# src/gallium/winsys/drm/Makefile
-
+# src/gallium/winsys/Makefile
 TOP = ../../../..
-
 include $(TOP)/configs/current
 
 SUBDIRS = $(GALLIUM_WINSYS_DRM_DIRS)
 
-default: $(TOP)/$(LIB_DIR)/gallium subdirs
-
-
-$(TOP)/$(LIB_DIR)/gallium:
-       -mkdir -p $(TOP)/$(LIB_DIR)/gallium
-
-
-subdirs:
-       @for dir in $(SUBDIRS) ; do \
-               if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE)) || exit 1 ; \
-               fi \
-       done
-
-
-install:
-       @for dir in $(SUBDIRS) ; do \
-               if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE) install) || exit 1 ; \
-               fi \
-       done
-
-
-clean:
+default install clean:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE) clean) ; \
+                       (cd $$dir && $(MAKE) $@) || exit 1; \
                fi \
        done
-       -rm -f common/*.o
index 78773b8..d8feef6 100644 (file)
@@ -1,27 +1,12 @@
+# src/gallium/winsys/drm/intel/Makefile
 TOP = ../../../../..
 include $(TOP)/configs/current
 
-
-# Always build gem and then build winsys with
-# enabled state trackers
 SUBDIRS = gem $(GALLIUM_STATE_TRACKERS_DIRS)
 
-
-default: subdirs
-
-
-subdirs:
+default install clean:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE)) || exit 1 ; \
+                       (cd $$dir && $(MAKE) $@) || exit 1; \
                fi \
        done
-
-
-clean:
-       rm -f `find . -name \*.[oa]`
-       rm -f `find . -name depend`
-
-
-# Dummy install target
-install:
index b573532..652cf71 100644 (file)
@@ -1,25 +1,12 @@
+# src/gallium/winsys/drm/nouveau/Makefile
 TOP = ../../../../..
 include $(TOP)/configs/current
 
-
 SUBDIRS = common dri
 
-
-default: subdirs
-
-
-subdirs:
+default install clean:
        @for dir in $(SUBDIRS) ; do \
                if [ -d $$dir ] ; then \
-                       (cd $$dir && $(MAKE)) || exit 1 ; \
+                       (cd $$dir && $(MAKE) $@) || exit 1; \
                fi \
        done
-
-
-clean:
-       rm -f `find . -name \*.[oa]`
-       rm -f `find . -name depend`
-
-
-# Dummy install target
-install: