mesa: added SUBDIRS support in dri/Makefile.template
authorBrian Paul <brianp@vmware.com>
Fri, 16 Oct 2009 15:21:45 +0000 (09:21 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 16 Oct 2009 19:07:43 +0000 (13:07 -0600)
src/mesa/drivers/dri/Makefile.template

index 18dbeba24a8916c0f656a966ae75d0c0a148c5b6..defead6c6b1bb2848f2f77c67d3ee66b64d6c3fc 100644 (file)
@@ -60,7 +60,7 @@ SHARED_INCLUDES = \
 
 ##### TARGETS #####
 
-default: symlinks depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
+default: symlinks subdirs depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
 
 
 $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
@@ -72,6 +72,18 @@ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
        $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) 
 
 
+# If the Makefile defined SUBDIRS, run make in each
+.PHONY: subdirs
+subdirs:
+       @if test -n "$(SUBDIRS)" ; then \
+               for dir in $(SUBDIRS) ; do \
+                       if [ -d $$dir ] ; then \
+                               (cd $$dir && $(MAKE)) || exit 1; \
+                       fi \
+               done \
+       fi
+
+
 depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
        @ echo "running $(MKDEP)"
        @ rm -f depend