Build libsoftpipe.a
authorKeith Whitwell <keith@tungstengraphics.com>
Wed, 1 Aug 2007 14:56:23 +0000 (15:56 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Wed, 1 Aug 2007 14:56:23 +0000 (15:56 +0100)
Each pipe driver will build to a .a library, as these will optionally
be included in the various DRI drivers (this will make more sense once
there is at least one hardware driver...).  Not strictly necessary for
softpipe, but want to minimize the differences between it and
actual hw implementations.

src/mesa/drivers/dri/Makefile.template
src/mesa/drivers/dri/i915pipe/Makefile
src/mesa/pipe/Makefile
src/mesa/pipe/Makefile.template [new file with mode: 0644]
src/mesa/pipe/softpipe/Makefile
src/mesa/pipe/softpipe/sp_context.c
src/mesa/pipe/softpipe/sp_prim_setup.h
src/mesa/pipe/softpipe/sp_quad_fs.c
src/mesa/sources
src/mesa/vf/vf.h

index 43c0e91..00b0961 100644 (file)
@@ -73,9 +73,9 @@ SHARED_INCLUDES = \
 default: depend symlinks $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME)
 
 
-$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
+$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
        $(TOP)/bin/mklib -noprefix -o $@ \
-               $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
+               $(OBJECTS) $(PIPE_DRIVERS) $(MESA_MODULES)  $(WINOBJ) $(DRI_LIB_DEPS)
 
 
 $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
index bf801f4..8cc8d91 100644 (file)
@@ -6,6 +6,9 @@ LIBNAME = i915tex_dri.so
 
 MINIGLX_SOURCES = server/intel_dri.c
 
+PIPE_DRIVERS = \
+       $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a
+
 DRIVER_SOURCES = \
        intel_regions.c \
        intel_buffer_objects.c \
index 451911a..ab7e09c 100644 (file)
@@ -1,2 +1,6 @@
 default:
        cd .. ; make
+       cd softpipe ; make
+
+clean:
+       rm -f `find . -name \*.[oa]`
\ No newline at end of file
diff --git a/src/mesa/pipe/Makefile.template b/src/mesa/pipe/Makefile.template
new file mode 100644 (file)
index 0000000..7c64981
--- /dev/null
@@ -0,0 +1,58 @@
+# -*-makefile-*-
+
+
+# We still have a dependency on the "dri" buffer manager.  Most likely
+# the interface can be reused in non-dri environments, and also as a
+# frontend to simpler memory managers.
+#
+COMMON_SOURCES = 
+
+OBJECTS = $(C_SOURCES:.c=.o) \
+         $(ASM_SOURCES:.S=.o) 
+
+
+### Include directories
+INCLUDES = \
+       -I. \
+       -I$(TOP)/src/mesa/drivers/dri/common \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/pipe \
+       -I$(TOP)/src/mesa 
+
+
+##### RULES #####
+
+.c.o:
+       $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES) $< -o $@
+
+.S.o:
+       $(CC) -c $(INCLUDES) $(CFLAGS) $(DRIVER_DEFINES)  $< -o $@
+
+
+##### TARGETS #####
+
+default:: depend symlinks $(LIBNAME)
+
+
+$(LIBNAME): $(OBJECTS) Makefile $(TOP)/src/mesa/pipe/Makefile.template
+       $(TOP)/bin/mklib -o $@ -static $(OBJECTS)
+
+
+depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS)
+       touch depend
+       $(MKDEP) $(MKDEP_OPTIONS) $(DRIVER_DEFINES) $(INCLUDES) $(C_SOURCES) \
+               $(ASM_SOURCES) 2> /dev/null
+
+
+# Emacs tags
+tags:
+       etags `find . -name \*.[ch]` `find ../include`
+
+
+# Remove .o and backup files
+clean:
+       -rm -f *.o */*.o *~ *.so *~ server/*.o $(SYMLINKS)
+       -rm -f depend depend.bak
+
+
+include depend
index 12a8bd0..947983b 100644 (file)
@@ -1,3 +1,44 @@
-default:
-       cd ../.. ; make
 
+TOP = ../../../..
+include $(TOP)/configs/current
+
+LIBNAME = softpipe
+
+DRIVER_SOURCES = \
+       sp_clear.c \
+       sp_context.c \
+       sp_prim_setup.c \
+       sp_quad.c \
+       sp_quad_alpha_test.c \
+       sp_quad_blend.c \
+       sp_quad_bufloop.c \
+       sp_quad_colormask.c \
+       sp_quad_coverage.c \
+       sp_quad_depth_test.c \
+       sp_quad_fs.c \
+       sp_quad_occlusion.c \
+       sp_quad_output.c \
+       sp_quad_stencil.c \
+       sp_quad_stipple.c \
+       sp_region.c \
+       sp_state_blend.c \
+       sp_state_clip.c \
+       sp_state_derived.c \
+       sp_state_fs.c \
+       sp_state_sampler.c \
+       sp_state_setup.c \
+       sp_state_surface.c \
+       sp_surface.c 
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(DRIVER_SOURCES)
+
+ASM_SOURCES = 
+
+include ../Makefile.template
+
+symlinks:
+
+default::
+       cd ../.. ; make
index 002fe73..434e183 100644 (file)
@@ -157,6 +157,7 @@ struct pipe_context *softpipe_create( void )
     * Create drawing context and plug our rendering stage into it.
     */
    softpipe->draw = draw_create();
+   assert(softpipe->draw);
    draw_set_setup_stage(softpipe->draw, sp_draw_render_stage(softpipe));
 
    sp_init_region_functions(softpipe);
index e5abefc..0180454 100644 (file)
@@ -41,8 +41,8 @@
 #include "imports.h"
 #if 0
 #include "s_tri_public.h"
-#endif
 #include "s_context.h"
+#endif
 
 
 extern struct draw_stage *sp_draw_render_stage( struct softpipe_context *softpipe );
index d4acf40..1676d47 100644 (file)
@@ -37,7 +37,7 @@
 #include "sp_context.h"
 #include "sp_headers.h"
 #include "sp_quad.h"
-#include "core/tgsi_core.h"
+#include "tgsi/core/tgsi_core.h"
 
 #if defined __GNUC__
 #define ALIGNED_ATTRIBS 1
index 3b820b7..d9ee726 100644 (file)
@@ -154,31 +154,6 @@ VF_SOURCES = \
        vf/vf_generic.c \
        vf/vf_sse.c
 
-SOFTPIPE_SOURCES = \
-       pipe/softpipe/sp_clear.c \
-       pipe/softpipe/sp_context.c \
-       pipe/softpipe/sp_region.c \
-       pipe/softpipe/sp_quad.c \
-       pipe/softpipe/sp_quad_alpha_test.c \
-       pipe/softpipe/sp_quad_blend.c \
-       pipe/softpipe/sp_quad_bufloop.c \
-       pipe/softpipe/sp_quad_colormask.c \
-       pipe/softpipe/sp_quad_coverage.c \
-       pipe/softpipe/sp_quad_depth_test.c \
-       pipe/softpipe/sp_quad_fs.c \
-       pipe/softpipe/sp_quad_occlusion.c \
-       pipe/softpipe/sp_quad_output.c \
-       pipe/softpipe/sp_quad_stipple.c \
-       pipe/softpipe/sp_quad_stencil.c \
-       pipe/softpipe/sp_state_blend.c \
-       pipe/softpipe/sp_state_clip.c \
-       pipe/softpipe/sp_state_derived.c \
-       pipe/softpipe/sp_state_fs.c \
-       pipe/softpipe/sp_state_sampler.c \
-       pipe/softpipe/sp_state_setup.c \
-       pipe/softpipe/sp_state_surface.c \
-       pipe/softpipe/sp_surface.c \
-       pipe/softpipe/sp_prim_setup.c
 
 DRAW_SOURCES = \
        pipe/draw/draw_clip.c \
@@ -367,7 +342,6 @@ SOLO_SOURCES = \
        $(MATH_SOURCES)         \
        $(VBO_SOURCES)          \
        $(VF_SOURCES)           \
-       $(SOFTPIPE_SOURCES)     \
        $(DRAW_SOURCES)         \
        $(TGSICORE_SOURCES)     \
        $(TGSIMESA_SOURCES)     \
index fc988b9..8ca3ab6 100644 (file)
@@ -29,7 +29,7 @@
 #define VF_VERTEX_H
 
 #include "mtypes.h"
-#include "m_vector.h"
+#include "math/m_vector.h"
 
 enum {
    VF_ATTRIB_POS = 0,