# Figure out what to make here
default:
@if [ "${DRIVER_DIRS}" = "dri" ] ; then \
- make linux-solo ; \
+ $(MAKE) linux-solo ; \
elif [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
- make osmesa-only ; \
+ $(MAKE) osmesa-only ; \
+ elif [ "$(DRIVER_DIRS)" = "beos" ]; then \
+ $(MAKE) beos ; \
+ elif [ "$(DRIVER_DIRS)" = "directfb" ]; then \
+ $(MAKE) directfb; \
else \
- make stand-alone ; \
+ $(MAKE) stand-alone ; \
fi
+# BeOS driver target
+beos: depend subdirs mesa.a
+ cd drivers/beos; $(MAKE)
+
######################################################################
# Linux solo DRI drivers
-SOLO_SOURCES = \
+SOLO_C_SOURCES = \
$(MAIN_SOURCES) \
$(MATH_SOURCES) \
$(ARRAY_CACHE_SOURCES) \
$(TNL_SOURCES) \
$(SWRAST_SOURCES) \
$(SWRAST_SETUP_SOURCES) \
- $(ASM_C_SOURCES) \
- $(X86_SOURCES)
+ $(SHADER_SOURCES) \
+ $(ASM_C_SOURCES)
-SOLO_OBJECTS = $(SOLO_SOURCES:.c=.o)
+SOLO_OBJECTS = $(SOLO_C_SOURCES:.c=.o) \
+ $(ASM_SOURCES:.S=.o)
-
-linux-solo: depend mesa.a drivers
+linux-solo: depend subdirs mesa.a drivers-dri
# Make archive of core object files
mesa.a: $(SOLO_OBJECTS)
rm -f $@
ar rcv $@ $(SOLO_OBJECTS)
ranlib $@
+ @if [ "${CONFIG_NAME}" = "beos" ] ; then \
+ mimeset -f "$@" ; \
+ fi
+
+# note: cannot use the name of the directory ("drivers") as the
+# target, otherwise make will look & see that the "drivers" directory
+# already exists, so not try to rebuild it...
+drivers-dri:
+ cd drivers/dri ; $(MAKE)
+
+
+
+#####################################################################
+# Stand-alone Mesa libGL, no built-in drivers (DirectFB)
+
+LIBGL_CORE_SOURCES = \
+ $(CORE_SOURCES) \
+ $(ASM_SOURCES)
+
+LIBGL_CORE_OBJECTS = \
+ $(CORE_OBJECTS) \
+ $(ASM_SOURCES:.S=.o)
+
+# Make libGL from core object files
+libgl-core: $(LIBGL_CORE_OBJECTS)
+ @ CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(GL_LIB) \
+ -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
+ -install $(LIB_DIR) $(MKLIB_OPTIONS) $(LIBGL_CORE_OBJECTS) $(GL_LIB_DEPS)
+
+# DirectFB driver target
+directfb: depend subdirs libgl-core
+ cd drivers/directfb; $(MAKE)
-drivers:
- cd drivers/dri ; make
######################################################################
$(OSMESA_DRIVER_OBJECTS)
-
stand-alone: depend subdirs $(LIB_DIR)/$(GL_LIB_NAME) $(LIB_DIR)/$(OSMESA_LIB_NAME)
osmesa-only: depend subdirs $(LIB_DIR)/$(OSMESA_LIB_NAME)
subdirs:
- @ (cd x86 ; make)
+ @ (cd x86 ; $(MAKE))
# Make the GL library
$(LIB_DIR)/$(GL_LIB_NAME): $(STAND_ALONE_OBJECTS)
- $(TOP)/bin/mklib -o $(GL_LIB) -major $(GL_MAJOR) \
- -minor $(GL_MINOR) -patch $(GL_TINY) -install $(LIB_DIR) \
+ @ CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(GL_LIB) \
+ -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
+ -install $(LIB_DIR) \
$(MKLIB_OPTIONS) $(GL_LIB_DEPS) $(STAND_ALONE_OBJECTS)
# Make the OSMesa library
$(LIB_DIR)/$(OSMESA_LIB_NAME): $(OSMESA_DRIVER_OBJECTS) $(OSMESA16_OBJECTS)
- if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
- $(TOP)/bin/mklib -o $(OSMESA_LIB) -major $(MESA_MAJOR) \
+ @ if [ "${DRIVER_DIRS}" = "osmesa" ] ; then \
+ CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(OSMESA_LIB) \
+ -major $(MESA_MAJOR) \
-minor $(MESA_MINOR) -patch $(MESA_TINY) \
-install $(LIB_DIR) $(MKLIB_OPTIONS) \
$(OSMESA_LIB_DEPS) $(OSMESA16_OBJECTS) ; \
else \
- $(TOP)/bin/mklib -o $(OSMESA_LIB) -major $(MESA_MAJOR) \
+ CC=$(CC) CXX=$(CXX) $(TOP)/bin/mklib -o $(OSMESA_LIB) \
+ -major $(MESA_MAJOR) \
-minor $(MESA_MINOR) -patch $(GL_TINY) \
-install $(LIB_DIR) $(MKLIB_OPTIONS) \
$(OSMESA_LIB_DEPS) $(OSMESA_DRIVER_OBJECTS) ; \
$(MATH_SOURCES) \
$(ARRAY_CACHE_SOURCES) \
$(TNL_SOURCES) \
+ $(SHADER_SOURCES) \
$(SWRAST_SOURCES) \
$(SWRAST_SETUP_SOURCES) \
$(ASM_C_SOURCES) \
$(X86_SOURCES) \
- $(COMMON_DRIVER_SOURCES)
+ $(COMMON_DRIVER_SOURCES)\
+ $(X11_DRIVER_SOURCES) \
+ $(OSMESA_DRIVER_SOURCES)
SUBDIRS = array_cache drivers/dri glapi main math sparc swrast swrast_setup \
# Update dependencies
depend: $(ALL_SOURCES)
- touch depend
- makedepend -fdepend -Y $(INCLUDE_DIRS) $(ALL_SOURCES) >& /dev/null
+ @ echo "running $(MKDEP)"
+ @ touch depend
+ $(MKDEP) $(MKDEP_OPTIONS) $(DEFINES) $(INCLUDE_DIRS) $(ALL_SOURCES) \
+ > /dev/null
# Emacs tags
tags:
- etags `find . -name \*.[ch]` `find ../include`
+ etags `find . -name \*.[ch]` $(TOP)/include/GL/*.h
clean:
-rm -f */*.o
- rm -f depend
- for dir in $(SUBDIRS) ; do \
- (cd $$dir ; make clean) ; \
- done
+ -rm -f depend depend.bak mesa.a
+ -rm -f drivers/*/*.o
+ (cd drivers/dri ; $(MAKE) clean)
include depend