lots of Makefile updates for new build system
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 8 Apr 2004 22:25:29 +0000 (22:25 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 8 Apr 2004 22:25:29 +0000 (22:25 +0000)
13 files changed:
src/mesa/drivers/dri/fb/Makefile
src/mesa/drivers/dri/ffb/Makefile
src/mesa/drivers/dri/gamma/Makefile
src/mesa/drivers/dri/i810/Makefile
src/mesa/drivers/dri/i830/Makefile
src/mesa/drivers/dri/mach64/Makefile
src/mesa/drivers/dri/mga/Makefile
src/mesa/drivers/dri/r128/Makefile
src/mesa/drivers/dri/r200/Makefile
src/mesa/drivers/dri/radeon/Makefile
src/mesa/drivers/dri/sis/Makefile
src/mesa/drivers/dri/tdfx/Makefile
src/mesa/drivers/dri/unichrome/Makefile

index 2d1253e04bdcbd35092171765da0836e0a52e4df..6d292aa3e08de16e5ca574487f3bfe06db3604c7 100644 (file)
@@ -1,66 +1,70 @@
 # src/mesa/drivers/dri/fb/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
-
-MESA_MODULES = $(TOP)/src/mesa/mesa.a
+LIBNAME = fb_dri.so
 
 DRIVER_SOURCES = fb_dri.c
 
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(DRI_SOURCES) 
-
-ASM_SOURCES = 
-
-OBJECTS = $(C_SOURCES:.c=.o) \
-         $(ASM_SOURCES:.S=.o) 
+C_SOURCES = \
+       $(DRIVER_SOURCES) \
+       $(DRI_SOURCES) 
 
 
-### Include directories
-
+# Include directories
 INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
        -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
        -I$(TOP)/src/mesa \
        -I$(TOP)/src/mesa/main \
        -I$(TOP)/src/mesa/glapi \
        -I$(TOP)/src/mesa/math \
        -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
        -I$(TOP)/src/mesa/swrast \
        -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
+MESA_MODULES = $(TOP)/src/mesa/mesa.a
+
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -lm -lpthread -lc
+
+
+ASM_SOURCES = 
+
+OBJECTS = $(C_SOURCES:.c=.o) \
+         $(ASM_SOURCES:.S=.o) 
+
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend fb_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
 
-fb_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc -lm
-       rm -f $(LIB_DIR)/fb_dri.so && \
-       install fb_dri.so $(LIB_DIR)/fb_dri.so
 
-$(LIB_DIR)/fb_dri.so:  fb_dri.so
-       rm -f $(LIB_DIR)/fb_dri.so && \
-       install fb_dri.so $(LIB_DIR)/fb_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
+
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -68,8 +72,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o *~ *.o *~ *.so
+       -rm -f *.o server/*.o
+
 
 include depend
index a761bad0582a3a8fc4e0d7684396c0e6d268463c..42ed196256d796f2ae41934e243c33b781fc86b8 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/ffb/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = ffb_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,42 +13,64 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 # not yet
 # MINIGLX_SOURCES = server/ffb_dri.c 
 
-DRIVER_SOURCES = ffb_bitmap.c \
-                ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c \
-                ../common/xmlconfig.c \
-                ffb_clear.c \
-                ffb_dd.c \
-                ffb_depth.c \
-                ffb_fog.c \
-                ffb_lines.c \
-                ffb_points.c \
-                ffb_span.c \
-                ffb_state.c \
-                ffb_stencil.c \
-                ffb_tex.c \
-                ffb_tris.c \
-                ffb_vb.c \
-                ffb_vtxfmt.c \
-                ffb_xmesa.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c \
+
+DRIVER_SOURCES = \
+       ffb_bitmap.c \
+       ffb_clear.c \
+       ffb_dd.c \
+       ffb_depth.c \
+       ffb_fog.c \
+       ffb_lines.c \
+       ffb_points.c \
+       ffb_span.c \
+       ffb_state.c \
+       ffb_stencil.c \
+       ffb_tex.c \
+       ffb_tris.c \
+       ffb_vb.c \
+       ffb_vtxfmt.c \
+       ffb_xmesa.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -60,56 +81,40 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-$(SYMLINKS):
-       mkdir -p server
-       cd server
-       rm -f $@ && ln -s ../../radeon/$@ $@
-
-
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend ffb_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
+
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
+
 
-ffb_dri.so:  $(SYMLINKS) $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/ffb_dri.so && \
-       install ffb_dri.so $(LIB_DIR)/ffb_dri.so
+$(SYMLINKS):
+       mkdir -p server
+       cd server
+       rm -f $@ && ln -s ../../radeon/$@ $@
 
-$(LIB_DIR)/ffb_dri.so: ffb_dri.so
-       rm -f $(LIB_DIR)/ffb_dri.so && \
-       install ffb_dri.so $(LIB_DIR)/ffb_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -117,10 +122,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
-       -rm -f $(SYMLINKS)
+       -rm -f *.o server/*.o
 
 
 include depend
index 8faf631417da4de61eaa095552748b48de50e231..0b5a6c8a5beecb5c39bc9f4676060172542eeed7 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/gamma/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = gamma_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,41 +13,62 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 # Not yet
 # MINIGLX_SOURCES = server/gamma_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c
+
 DRIVER_SOURCES = \
-               gamma_context.c \
-               gamma_dd.c \
-               gamma_inithw.c \
-               gamma_lock.c \
-               gamma_render.c \
-               gamma_screen.c \
-               gamma_span.c \
-               gamma_state.c \
-               gamma_tex.c \
-               gamma_texmem.c \
-               gamma_texstate.c \
-               gamma_tris.c \
-               gamma_vb.c \
-               gamma_xmesa.c \
-               ../../common/driverfuncs.c \
-               ../common/mm.c \
-               ../common/utils.c \
-               ../common/texmem.c \
-               ../common/vblank.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+       gamma_context.c \
+       gamma_dd.c \
+       gamma_inithw.c \
+       gamma_lock.c \
+       gamma_render.c \
+       gamma_screen.c \
+       gamma_span.c \
+       gamma_state.c \
+       gamma_tex.c \
+       gamma_texmem.c \
+       gamma_texstate.c \
+       gamma_tris.c \
+       gamma_vb.c \
+       gamma_xmesa.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -59,50 +79,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend gamma_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-gamma_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/gamma_dri.so && \
-       install gamma_dri.so $(LIB_DIR)/gamma_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/gamma_dri.so: gamma_dri.so
-       rm -f $(LIB_DIR)/gamma_dri.so && \
-       install gamma_dri.so $(LIB_DIR)/gamma_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -110,8 +114,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
+
 
 include depend
index c38a5a334de42b7e162ef18a0e376c94a28ee566..51299cf4011f309705def7442174e119e5985c5d 100644 (file)
@@ -1,11 +1,9 @@
 # src/mesa/drivers/dri/i810/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = i810_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -15,38 +13,59 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 # Not yet
 # MINIGLX_SOURCES = server/i810_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+        ../common/mm.c \
+        ../common/utils.c \
+        ../common/texmem.c \
+        ../common/vblank.c
+
 DRIVER_SOURCES = \
-               i810context.c \
-               i810ioctl.c \
-               i810render.c \
-               i810screen.c \
-               i810span.c \
-               i810state.c \
-               i810tex.c \
-               i810texmem.c \
-               i810texstate.c \
-               i810tris.c \
-               i810vb.c \
-               ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+       i810context.c \
+       i810ioctl.c \
+       i810render.c \
+       i810screen.c \
+       i810span.c \
+       i810state.c \
+       i810tex.c \
+       i810texmem.c \
+       i810texstate.c \
+       i810tris.c \
+       i810vb.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -57,50 +76,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend i810_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-i810_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/i810_dri.so && \
-       install i810_dri.so $(LIB_DIR)/i810_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/i810_dri.so:        i810_dri.so
-       rm -f $(LIB_DIR)/i810_dri.so && \
-       install i810_dri.so $(LIB_DIR)/i810_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES)
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -108,9 +111,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend
index 55a28728cac15eae71111afca41af5e14fcf8ebd..a857814a78b348d2abc9c12de5232d42e5e0425a 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/i830/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = i830_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,38 +13,60 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 # Not yet
 # MINIGLX_SOURCES = server/i830_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
 DRIVER_SOURCES = \
-               i830_context.c \
-               i830_debug.c \
-               i830_ioctl.c \
-               i830_render.c \
-               i830_screen.c \
-               i830_span.c \
-               i830_state.c \
-               i830_tex.c \
-               i830_texmem.c \
-               i830_texstate.c \
-               i830_tris.c \
-               ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+       i830_context.c \
+       i830_debug.c \
+       i830_ioctl.c \
+       i830_render.c \
+       i830_screen.c \
+       i830_span.c \
+       i830_state.c \
+       i830_tex.c \
+       i830_texmem.c \
+       i830_texstate.c \
+       i830_tris.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -56,50 +77,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend i830_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-i830_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/i830_dri.so && \
-       install i830_dri.so $(LIB_DIR)/i830_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/i830_dri.so:        i830_dri.so
-       rm -f $(LIB_DIR)/i830_dri.so && \
-       install i830_dri.so $(LIB_DIR)/i830_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES)
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -107,9 +112,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend
index 8cfceafa3251b4f0ce8124b16ac1e7a0817c0889..e9ea1c1feec2f04a31061f2901efbb47bc3e9296 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/mach64/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = mach64_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,39 +13,61 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 # Not yet
 # MINIGLX_SOURCES = server/mach64_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
 DRIVER_SOURCES = \
-               mach64_context.c \
-               mach64_ioctl.c \
-               mach64_screen.c \
-               mach64_span.c \
-               mach64_state.c \
-               mach64_tex.c \
-               mach64_texmem.c \
-               mach64_texstate.c \
-               mach64_tris.c \
-               mach64_vb.c \
-               mach64_dd.c \
-               mach64_lock.c \
-               ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+       mach64_context.c \
+       mach64_ioctl.c \
+       mach64_screen.c \
+       mach64_span.c \
+       mach64_state.c \
+       mach64_tex.c \
+       mach64_texmem.c \
+       mach64_texstate.c \
+       mach64_tris.c \
+       mach64_vb.c \
+       mach64_dd.c \
+       mach64_lock.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -57,50 +78,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend mach64_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-mach64_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/mach64_dri.so && \
-       install mach64_dri.so $(LIB_DIR)/mach64_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/mach64_dri.so: mach64_dri.so
-       rm -f $(LIB_DIR)/mach64_dri.so && \
-       install mach64_dri.so $(LIB_DIR)/mach64_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -108,9 +113,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend
index 6f3bf8d4e82f6bde9f25fbcf66d1d8d988d57a8b..7d9745248df6dbd7681cbcfa4f7e75c2cea2c0d7 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/mga/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = mga_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -18,39 +17,60 @@ DEFINES += \
 
 MINIGLX_SOURCES = server/mga_dri.c 
 
-DRIVER_SOURCES = mgadd.c \
-                mgaioctl.c \
-                mgarender.c \
-                mgastate.c \
-                mgatris.c \
-                ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c \
-                ../common/xmlconfig.c
-
-FULL_DRIVER_SOURCES =  \
-                mgapixel.c \
-                mgaspan.c \
-                mgatex.c \
-                mgatexmem.c \
-                mga_texstate.c \
-                mga_texcombine.c \
-                mgavb.c \
-                mga_xmesa.c
-
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(MINIGLX_SOURCES) \
-           $(FULL_DRIVER_SOURCES) \
-           $(DRIVER_SOURCES) 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
+DRIVER_SOURCES = \
+       mgadd.c \
+       mgaioctl.c \
+       mgarender.c \
+       mgastate.c \
+       mgatris.c
+
+FULL_DRIVER_SOURCES = \
+       mgapixel.c \
+       mgaspan.c \
+       mgatex.c \
+       mgatexmem.c \
+       mga_texstate.c \
+       mga_texcombine.c \
+       mgavb.c \
+       mga_xmesa.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES) \
+       $(FULL_DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -61,52 +81,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
 
-
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
-
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend mga_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-mga_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/mga_dri.so && \
-       install mga_dri.so $(LIB_DIR)/mga_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/mga_dri.so: mga_dri.so
-       rm -f $(LIB_DIR)/mga_dri.so && \
-       install mga_dri.so $(LIB_DIR)/mga_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES)
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -114,9 +116,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend
index 6424203bff45065c9f5eccf24b81a2bc4c7341b1..edd6803b89d1d5a1632e849555881aff6be83d18 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/r128/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = r128_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,39 +13,60 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 MINIGLX_SOURCES = server/r128_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
 DRIVER_SOURCES = \
-               r128_context.c \
-               r128_lock.c \
-               r128_state.c \
-               r128_texstate.c \
-               r128_dd.c \
-               r128_screen.c \
-               r128_tex.c \
-               r128_tris.c \
-               r128_ioctl.c \
-               r128_span.c \
-               r128_texmem.c \
-               r128_vb.c \
-               ../../common/driverfuncs.c \
-               ../common/mm.c \
-               ../common/utils.c \
-               ../common/texmem.c \
-               ../common/vblank.c \
-               ../common/xmlconfig.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+       r128_context.c \
+       r128_lock.c \
+       r128_state.c \
+       r128_texstate.c \
+       r128_dd.c \
+       r128_screen.c \
+       r128_tex.c \
+       r128_tris.c \
+       r128_ioctl.c \
+       r128_span.c \
+       r128_texmem.c \
+       r128_vb.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(DRIVER_SOURCES) \
+       $(MINIGLX_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -57,50 +77,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend r128_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-r128_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/r128_dri.so && \
-       install r128_dri.so $(LIB_DIR)/r128_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/r128_dri.so: r128_dri.so
-       rm -f $(LIB_DIR)/r128_dri.so && \
-       install r128_dri.so $(LIB_DIR)/r128_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -108,9 +112,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend
index 37b42d3f4206cecfeb98c01e3f1f68460ae2c084..b3d795565635fefdc444f184d5049a907e6b5111 100644 (file)
@@ -1,10 +1,10 @@
 # src/mesa/drivers/dri/r200/Makefile
+# Note, this Makefile requires GNU make
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = r200_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,22 +14,24 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 MINIGLX_SOURCES = server/radeon_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
 DRIVER_SOURCES = r200_context.c \
                 r200_ioctl.c \
                 r200_lock.c \
                 r200_screen.c \
                 r200_state.c \
                 r200_state_init.c \
-                ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c \
-                ../common/xmlconfig.c \
                 r200_cmdbuf.c \
                 r200_pixel.c \
                 r200_tex.c \
@@ -45,17 +47,34 @@ DRIVER_SOURCES = r200_context.c \
                 r200_vtxfmt_sse.c \
                 r200_vtxfmt_x86.c 
 
+C_SOURCES = $(COMMON_SOURCES) $(MINIGLX_SOURCES) $(DRIVER_SOURCES)
 
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
 
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
+
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
 WINLIB=
@@ -65,6 +84,7 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
@@ -78,53 +98,35 @@ SYMLINKS = \
        server/radeon_sarea.h \
 
 
-$(SYMLINKS):
-       mkdir -p server
-       cd server
-       rm -f $@ && ln -s ../../radeon/$@ $@
-
-
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend r200_dri.so
+default: depend $(SYMLINKS) $(LIB_DIR)/$(LIBNAME)
+
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
+
 
-r200_dri.so:  $(SYMLINKS) $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/r200_dri.so && \
-       install r200_dri.so $(LIB_DIR)/r200_dri.so
+$(SYMLINKS):
+       mkdir -p server
+       cd server
+       rm -f $@ && ln -s ../../radeon/$@ $@
 
-$(LIB_DIR)/r200_dri.so:        r200_dri.so
-       rm -f $(LIB_DIR)/r200_dri.so && \
-       install r200_dri.so $(LIB_DIR)/r200_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -132,9 +134,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
        -rm -f $(SYMLINKS)
 
 
index 9dd7c97c7f4742a4a19f86bda7f18b1f2be0cabb..cbc21e45a858c6472c56b91ab3e2a63ba89e7afb 100644 (file)
@@ -1,15 +1,13 @@
 # src/mesa/drivers/dri/radeon/Makefile
+# Note, this Makefile requires GNU make
 
 TOP = ../../../../..
-include $(TOP)/configs/default
-
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+include $(TOP)/configs/current
 
 ifeq ($(EMBEDDED),true)
-TARGET = radeon_es_dri.so
+LIBNAME = radeon_es_dri.so
 DEFINES += \
-              -D_EMBEDDED \
+       -D_EMBEDDED \
        -D_HAVE_SWRAST=0 \
        -D_HAVE_SWTNL=0 \
        -D_HAVE_SANITY=0 \
@@ -19,7 +17,7 @@ DEFINES += \
        -D_HAVE_USERCLIP=0 \
        -DGLX_DIRECT_RENDERING
 else
-TARGET = radeon_dri.so
+LIBNAME = radeon_dri.so
 DEFINES += \
        -D_HAVE_SWRAST=1 \
        -D_HAVE_SWTNL=1 \
@@ -31,61 +29,85 @@ DEFINES += \
        -DGLX_DIRECT_RENDERING
 endif
 
-MESA_MODULES = $(TOP)/src/mesa/mesa.a
-
 MINIGLX_SOURCES = server/radeon_dri.c 
 
-DRIVER_SOURCES = radeon_context.c \
-                radeon_ioctl.c \
-                radeon_lock.c \
-                radeon_screen.c \
-                radeon_state.c \
-                radeon_state_init.c \
-                ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c \
-                ../common/xmlconfig.c
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
+DRIVER_SOURCES = \
+       radeon_context.c \
+       radeon_ioctl.c \
+       radeon_lock.c \
+       radeon_screen.c \
+       radeon_state.c \
+       radeon_state_init.c
 
 SUBSET_DRIVER_SOURCES = \
-               radeon_subset_bitmap.c \
-               radeon_subset_readpix.c \
-               radeon_subset_select.c \
-               radeon_subset_tex.c \
-               radeon_subset_vtx.c 
-
-FULL_DRIVER_SOURCES =  \
-                radeon_tex.c \
-                radeon_texmem.c \
-                radeon_texstate.c \
-                radeon_tcl.c \
-                radeon_swtcl.c \
-                radeon_span.c \
-                radeon_maos.c \
-                radeon_sanity.c \
-                radeon_compat.c \
-                radeon_vtxfmt.c \
-                radeon_vtxfmt_c.c \
-                radeon_vtxfmt_sse.c \
-                radeon_vtxfmt_x86.c 
-
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
+       radeon_subset_bitmap.c \
+       radeon_subset_readpix.c \
+       radeon_subset_select.c \
+       radeon_subset_tex.c \
+       radeon_subset_vtx.c 
+
+FULL_DRIVER_SOURCES = \
+       radeon_tex.c \
+       radeon_texmem.c \
+       radeon_texstate.c \
+       radeon_tcl.c \
+       radeon_swtcl.c \
+       radeon_span.c \
+       radeon_maos.c \
+       radeon_sanity.c \
+       radeon_compat.c \
+       radeon_vtxfmt.c \
+       radeon_vtxfmt_c.c \
+       radeon_vtxfmt_sse.c \
+       radeon_vtxfmt_x86.c 
 
 ifeq ($(EMBEDDED),true)
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(SUBSET_DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES) \
+       $(SUBSET_DRIVER_SOURCES)
 else
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(FULL_DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES) \
+       $(FULL_DRIVER_SOURCES)
 endif
 
 
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
+
+# Core Mesa objects
+MESA_MODULES = $(TOP)/src/mesa/mesa.a
+
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
+
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
 WINLIB=
@@ -95,50 +117,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend $(TARGET)
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-$(TARGET):  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/$(TARGET) && \
-       install $(TARGET) $(LIB_DIR)/$(TARGET)
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/$(TARGET):  $(TARGET)
-       rm -f $(LIB_DIR)/$(TARGET) && \
-       install $(TARGET) $(LIB_DIR)/$(TARGET)
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES)\
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -146,9 +152,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend
index bd7b36db5d9b6276b718230d0ecd6ca5de0594fd..375fc9b26d9daa7f021c26393b4eaa086b5b555b 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/sis/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = sis_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,41 +13,63 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 # Not yet
 # MINIGLX_SOURCES = server/sis_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
 DRIVER_SOURCES = \
-               sis_alloc.c \
-               sis_clear.c \
-               sis_context.c \
-               sis_dd.c \
-               sis_fog.c \
-               sis_lock.c \
-               sis_screen.c \
-               sis_span.c \
-               sis_state.c \
-               sis_stencil.c \
-               sis_tex.c \
-               sis_texstate.c \
-               sis_tris.c \
-               sis_vb.c \
-               ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+       sis_alloc.c \
+       sis_clear.c \
+       sis_context.c \
+       sis_dd.c \
+       sis_fog.c \
+       sis_lock.c \
+       sis_screen.c \
+       sis_span.c \
+       sis_state.c \
+       sis_stencil.c \
+       sis_tex.c \
+       sis_texstate.c \
+       sis_tris.c \
+       sis_vb.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -59,50 +80,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend sis_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-sis_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/sis_dri.so && \
-       install sis_dri.so $(LIB_DIR)/sis_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/sis_dri.so: sis_dri.so
-       rm -f $(LIB_DIR)/sis_dri.so && \
-       install sis_dri.so $(LIB_DIR)/sis_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -110,9 +115,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend
index 8c6ebc1a37fe30ebd9717ec64c08d3a4723b9863..fbe2d44596d5a25caa8f51759e6a7e9b72efc1e4 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/tdfx/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = tdfx_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,40 +13,62 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 # not yet
 # MINIGLX_SOURCES = server/tdfx_dri.c 
 
-DRIVER_SOURCES = tdfx_context.c \
-               ../../common/driverfuncs.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c \
-                ../common/xmlconfig.c \
-                tdfx_dd.c \
-                tdfx_lock.c \
-                tdfx_pixels.c \
-                tdfx_render.c \
-                tdfx_screen.c \
-                tdfx_span.c \
-                tdfx_state.c \
-                tdfx_tex.c \
-                tdfx_texman.c \
-                tdfx_texstate.c \
-                tdfx_tris.c \
-                tdfx_vb.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
+DRIVER_SOURCES = \
+       tdfx_context.c \
+       tdfx_dd.c \
+       tdfx_lock.c \
+       tdfx_pixels.c \
+       tdfx_render.c \
+       tdfx_screen.c \
+       tdfx_span.c \
+       tdfx_state.c \
+       tdfx_tex.c \
+       tdfx_texman.c \
+       tdfx_texstate.c \
+       tdfx_tris.c \
+       tdfx_vb.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -58,56 +79,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-$(SYMLINKS):
-       mkdir -p server
-       cd server
-       rm -f $@ && ln -s ../../radeon/$@ $@
-
-
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend tdfx_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-tdfx_dri.so:  $(SYMLINKS) $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/tdfx_dri.so && \
-       install tdfx_dri.so $(LIB_DIR)/tdfx_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/tdfx_dri.so:        tdfx_dri.so
-       rm -f $(LIB_DIR)/tdfx_dri.so && \
-       install tdfx_dri.so $(LIB_DIR)/tdfx_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -115,9 +114,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
-       -rm -f $(SYMLINKS)
+       -rm -f *.o server/*.o
+
 
 include depend
index fe8f970c1559af2b09cc5115989bc9d1b8e40e70..95540e1c676515ed944d942a599b99e598e34b05 100644 (file)
@@ -1,10 +1,9 @@
 # src/mesa/drivers/dri/unichrome/Makefile
 
 TOP = ../../../../..
-include $(TOP)/configs/default
+include $(TOP)/configs/current
 
-SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
-MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+LIBNAME = unichrome_dri.so
 
 DEFINES += \
        -D_HAVE_SWRAST=1 \
@@ -14,40 +13,61 @@ DEFINES += \
        -D_HAVE_LIGHTING=1 \
        -D_HAVE_TEXGEN=1 \
        -D_HAVE_USERCLIP=1 \
-       -DGLX_DIRECT_RENDERING 
+       -DGLX_DIRECT_RENDERING
 
 MINIGLX_SOURCES = server/via_dri.c 
 
+COMMON_SOURCES = \
+       ../../common/driverfuncs.c \
+       ../common/mm.c \
+       ../common/utils.c \
+       ../common/texmem.c \
+       ../common/vblank.c \
+       ../common/xmlconfig.c
+
 DRIVER_SOURCES = \
-               via_context.c \
-               via_fb.c \
-               via_ioctl.c \
-               via_render.c \
-               via_screen.c \
-               via_span.c \
-               via_state.c \
-               via_tex.c \
-               via_texmem.c \
-               via_texstate.c \
-               via_tris.c \
-               via_vb.c \
-               xf86drmVIA.c \
-                ../common/mm.c \
-                ../common/utils.c \
-                ../common/texmem.c \
-                ../common/vblank.c \
-               ../common/xmlconfig.c \
-               ../../common/driverfuncs.c
-
-INCLUDES = $(MINIGLX_INCLUDES) \
-          $(SHARED_INCLUDES)
-
-
-C_SOURCES = $(DRIVER_SOURCES) \
-           $(MINIGLX_SOURCES) 
+       via_context.c \
+       via_fb.c \
+       via_ioctl.c \
+       via_render.c \
+       via_screen.c \
+       via_span.c \
+       via_state.c \
+       via_tex.c \
+       via_texmem.c \
+       via_texstate.c \
+       via_tris.c \
+       via_vb.c \
+       xf86drmVIA.c
+
+C_SOURCES = \
+       $(COMMON_SOURCES) \
+       $(MINIGLX_SOURCES) \
+       $(DRIVER_SOURCES)
+
+# Include directories
+INCLUDE_DIRS = \
+       -I. \
+       -I../common \
+       -Iserver \
+       -I$(TOP)/src/glx/mini \
+       -I$(TOP)/include \
+       -I$(TOP)/src/mesa/drivers/dri/drm/shared \
+       -I$(TOP)/src/mesa \
+       -I$(TOP)/src/mesa/main \
+       -I$(TOP)/src/mesa/glapi \
+       -I$(TOP)/src/mesa/math \
+       -I$(TOP)/src/mesa/transform \
+       -I$(TOP)/src/mesa/shader \
+       -I$(TOP)/src/mesa/swrast \
+       -I$(TOP)/src/mesa/swrast_setup
 
+# Core Mesa objects
 MESA_MODULES = $(TOP)/src/mesa/mesa.a
 
+# Libraries that the driver shared lib depends on
+LIB_DEPS = -L/usr/X11R6/lib -lX11 -lXext -lm -lpthread -lexpat -ldl -lc
+
 
 ifeq ($(WINDOW_SYSTEM),dri)
 WINOBJ=$(MESABUILDDIR)/dri/dri.a
@@ -58,50 +78,34 @@ WINLIB=-L$(MESA)/src/glx/mini
 endif
 
 ASM_SOURCES = 
+
 OBJECTS = $(C_SOURCES:.c=.o) \
          $(ASM_SOURCES:.S=.o) 
 
-### Include directories
-
-INCLUDE_DIRS = \
-       -I$(TOP)/include \
-       -I$(TOP)/src/mesa \
-       -I$(TOP)/src/mesa/main \
-       -I$(TOP)/src/mesa/glapi \
-       -I$(TOP)/src/mesa/math \
-       -I$(TOP)/src/mesa/transform \
-       -I$(TOP)/src/mesa/swrast \
-       -I$(TOP)/src/mesa/swrast_setup
-
 
 ##### RULES #####
 
 .c.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@
 
 .S.o:
-       $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES)  $< -o $@
+       $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES)  $< -o $@
 
 
 ##### TARGETS #####
 
-default: depend unichrome_dri.so
+default: depend $(LIB_DIR)/$(LIBNAME)
+
 
-unichrome_dri.so:  $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.solo
-       rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
-       rm -f $(LIB_DIR)/unichrome_dri.so && \
-       install unichrome_dri.so $(LIB_DIR)/unichrome_dri.so
+$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile
+       $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(LIB_DIR) \
+               $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) $(OBJECTS)
 
-$(LIB_DIR)/unichrome_dri.so:   unichrome_dri.so
-       rm -f $(LIB_DIR)/unichrome_dri.so && \
-       install unichrome_dri.so $(LIB_DIR)/unichrome_dri.so
 
-# Run 'make -f Makefile.solo dep' to update the dependencies if you change
-# what's included by any source file.
 depend: $(C_SOURCES) $(ASM_SOURCES)
        touch depend
-       makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
-               $(C_SOURCES) $(ASM_SOURCES) >& /dev/null
+       $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \
+               >& /dev/null
 
 
 # Emacs tags
@@ -109,9 +113,8 @@ tags:
        etags `find . -name \*.[ch]` `find ../include`
 
 
-# Remove .o and backup files
 clean:
-       -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+       -rm -f *.o server/*.o
 
 
 include depend