SRC_DIRS = mesa glu glut/glx
+MKDEP_OPTIONS = -fdepend -Y
+
+
GL_LIB_DEPS = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread \
-L$(SDK)/lib -m32 -Wl,-m,elf32ppc -R$(SDK)/lib -lspe
ifeq ($(CONFIG_NAME), linux-cell)
CELL_LIB = $(TOP)/src/mesa/pipe/cell/ppu/libcell.a
+CELL_LIB_SPU = $(TOP)/src/mesa/pipe/cell/spu/g3d_spu.a
endif
osmesa-only: depend subdirs $(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME)
# Make the GL library
-$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(SOFTPIPE_LIB) $(CELL_LIB)
+$(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS) $(SOFTPIPE_LIB) $(CELL_LIB) $(CELL_LIB_SPU)
@ $(TOP)/bin/mklib -o $(GL_LIB) \
-major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
-install $(TOP)/$(LIB_DIR) \
$(MKLIB_OPTIONS) $(STAND_ALONE_OBJECTS) \
- $(SOFTPIPE_LIB) $(CELL_LIB)$(GL_LIB_DEPS)
+ $(SOFTPIPE_LIB) $(CELL_LIB) $(CELL_LIB_SPU) $(GL_LIB_DEPS)
# Make the OSMesa library
$(TOP)/$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
SPU_CODE_MODULE = ../spu/g3d_spu.a
-OBJECTS = cell_context.o cell_surface.o
+
+SOURCES = \
+ cell_context.c \
+ cell_surface.c
+
+OBJECTS = $(SOURCES:.c=.o) \
INCLUDE_DIRS = -I$(TOP)/src/mesa
$(CELL_LIB): $(OBJECTS) $(SPU_CODE_MODULE)
- ar -ru $(CELL_LIB) $(OBJECTS) $(SPU_CODE_MODULE)
+# ar -ru $(CELL_LIB) $(OBJECTS) $(SPU_CODE_MODULE)
+ ar -ru $(CELL_LIB) $(OBJECTS)
#$(PROG): $(PPU_OBJECTS)
# $(CC) -o $(PROG) $(PPU_OBJECTS) $(SPU_CODE_MODULE) $(PPU_LFLAGS)
clean:
rm -f *.o $(CELL_LIB)
+
+
+
+depend: $(SOURCES)
+ rm -f depend
+ touch depend
+ $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(SOURCES) 2> /dev/null
+
+include depend
+
+
+
-# Gallium3D Cell driver: PPU code
+# Gallium3D Cell driver: SPU code
# This makefile builds the g3d_spu.a file that's linked into the
# PPU code/library.
PROG_SPU_EMBED_O = $(PROG)_spu-embed.o
-SPU_OBJECTS = main.o tri.o
+SOURCES = \
+ main.c \
+ tri.c
+
+SPU_OBJECTS = $(SOURCES:.c=.o) \
+
+INCLUDE_DIRS = -I$(TOP)/src/mesa
# The .a file will be linked into the main/PPU executable
clean:
rm -f *.o *.a *.d $(PROG_SPU)
+
+
+
+depend: $(SOURCES)
+ rm -f depend
+ touch depend
+ $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(SOURCES) 2> /dev/null
+
+include depend
+