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 43c0e912bf25540f98cf79f094b1c0e81ebe1de2..00b09613ec2959365920b51942397630212eaa3e 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 bf801f4bdddbe113e420fab3c6ce1533977ab182..8cc8d912644e5dacb0c8993d5856e0448ac4e108 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 451911a35453377c05afe7889e4ce79ca04844c4..ab7e09c991871f2aecfb36bf807eeb60c71bc18a 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 12a8bd0409e07cc5a3a52aa42117f7e383214b20..947983baf0786a0ebf21f1ca5f5261536537d24c 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 002fe73b59d936298bfaa1e22b8724026c599522..434e18308ab69a144a29888d1e1bca865c362366 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 e5abefcd499702d94616514e762d7a05bb87bb63..0180454a8d2c498f965df8e35594b8876864be65 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 d4acf402ce7f4303a574fa2a607bf58e401696b9..1676d47d51b6a1eea696aa5db25b87843a24e1e0 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 3b820b71f0e35456ab96aa6f79cff0ed201cbad7..d9ee7266e54cdb49b9d366e50501cbe3f64e27e6 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 fc988b9fb9aa8231cb3843bee456c9a51a48affe..8ca3ab6d4a6ab7ad7d9249cd57b1086fa6ca1fb3 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,