Merge commit 'origin/master' into gallium-0.2
[mesa.git] / src / mesa / Makefile
index 6b4057030ef00154dbe300885ae74ac8c48e2e83..97b011a7d45cb5af50fa65a6b50bec0ffa3bc34a 100644 (file)
@@ -3,8 +3,7 @@
 TOP = ../..
 include $(TOP)/configs/current
 
-include sources
-
+include sources.mak
 
 .SUFFIXES : .cpp
 
@@ -24,6 +23,9 @@ include sources
 default: depend asm_subdirs libmesa.a libglapi.a driver_subdirs
 
 
+# Default: build dependencies, then asm_subdirs, then convenience
+# libs (.a) and finally the device drivers:
+default: depend asm_subdirs libmesa.a $(GLAPI_LIB) driver_subdirs
 
 ######################################################################
 # Helper libraries used by many drivers:
@@ -36,6 +38,13 @@ libmesa.a: $(MESA_OBJECTS)
 libglapi.a: $(GLAPI_OBJECTS)
        @ $(MKLIB) -o glapi -static $(GLAPI_OBJECTS)
 
+# Make archive of gl* API dispatcher functions only
+$(GLAPI_LIB): $(GLAPI_OBJECTS)
+       @if [ "${WINDOW_SYSTEM}" = "dri" ] ; then \
+               touch libglapi.a ; \
+       else \
+               $(TOP)/bin/mklib -o glapi -static $(GLAPI_OBJECTS) ; \
+       fi
 
 ######################################################################
 # Device drivers