Merge remote branch 'origin/master' into glsl2
[mesa.git] / src / mesa / Makefile
index 7073c92240b3c55d8efb1c2a7645b9fb72a24f7d..f97720093c8f2b14cbd32929f87793e33d0462dc 100644 (file)
@@ -42,16 +42,26 @@ MESA_GALLIUM_OBJECTS := $(addprefix $(MESA_OBJ_DIR)/, $(MESA_GALLIUM_OBJECTS))
 MESA_INCLUDES := $(INCLUDE_DIRS)
 ES1_INCLUDES := -I$(TOP)/src/mapi/es1api $(INCLUDE_DIRS)
 ES2_INCLUDES := -I$(TOP)/src/mapi/es2api $(INCLUDE_DIRS)
-
+MESA_INCLUDES := -I$(TOP)/src/glsl $(MESA_INCLUDES)
+# For symbol_table.h in glsl compiler headers.
+MESA_INCLUDES := -I$(TOP)/src/mesa/shader $(MESA_INCLUDES)
 
 define mesa-cc-c
        @mkdir -p $(dir $@)
        $(CC) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_INCLUDES) $(CFLAGS)
 endef
 
+define mesa-cxx-c
+       @mkdir -p $(dir $@)
+       $(CXX) -c -o $@ $< $($(1)_CPPFLAGS) $($(1)_INCLUDES) $(CXXFLAGS)
+endef
+
 $(MESA_OBJ_DIR)/%.o: %.c
        $(call mesa-cc-c,MESA)
 
+$(MESA_OBJ_DIR)/%.o: %.cpp
+       $(call mesa-cxx-c,MESA)
+
 $(MESA_OBJ_DIR)/%.o: %.S
        $(call mesa-cc-c,MESA)
 
@@ -70,7 +80,7 @@ $(ES2_OBJ_DIR)/%.o: %.S
 
 # Default: build dependencies, then asm_subdirs, GLSL built-in lib,
 # then convenience libs (.a) and finally the device drivers:
-default: $(DEPENDS) asm_subdirs glsl_builtin \
+default: $(DEPENDS) asm_subdirs \
        $(MESA_LIBS) $(ES1_LIBS) $(ES2_LIBS) driver_subdirs
 
 main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py main/APIspec.py
@@ -120,12 +130,6 @@ asm_subdirs:
        fi
 
 
-######################################################################
-# GLSL built-in library
-glsl_builtin:
-       (cd slang/library && $(MAKE)) || exit 1 ;
-
-
 ######################################################################
 # Dependency generation
 
@@ -241,7 +245,6 @@ clean: clean-es1 clean-es2
        -rm -f depend depend.bak libmesa.a libmesagallium.a
        -rm -f drivers/*/*.o
        -rm -f *.pc
-       -rm -f slang/library/*_gc.h
        -@cd drivers/dri && $(MAKE) clean
        -@cd drivers/x11 && $(MAKE) clean
        -@cd drivers/osmesa && $(MAKE) clean