GLAPI_ASM_SOURCES := $(addprefix $(GEN)/, $(GLAPI_ASM_SOURCES))
include $(MAPI)/sources.mak
-MAPI_GLAPI_OBJECTS := $(MAPI_GLAPI_SOURCES:.c=.o)
-MAPI_GLAPI_SOURCES := $(addprefix $(MAPI)/, $(MAPI_GLAPI_SOURCES))
+MAPI_UTIL_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
+MAPI_UTIL_SOURCES := $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
-ESAPI_OBJECTS = $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS) $(MAPI_GLAPI_OBJECTS)
+ESAPI_OBJECTS = $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS) $(MAPI_UTIL_OBJECTS)
INCLUDE_DIRS = \
-I$(TOP)/include \
@$(MKLIB) -o $(ESAPI) -static $(ESAPI_OBJECTS)
$(GLAPI_OBJECTS): %.o: $(GLAPI)/%.c
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_GLAPI_CURRENT $< -o $@
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
$(GLAPI_ASM_OBJECTS): %.o: $(GEN)/%.S
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-$(MAPI_GLAPI_OBJECTS): %.o: $(MAPI)/%.c
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_GLAPI_CURRENT $< -o $@
+$(MAPI_UTIL_OBJECTS): %.o: $(MAPI)/%.c
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
$(GLAPI_SOURCES) $(GLAPI_ASM_SOURCES): | glapi-stamp
$(MINSTALL) $(TOP)/$(LIB_DIR)/$(GLES_LIB_GLOB) \
$(DESTDIR)$(INSTALL_LIB_DIR)
-depend: $(GLAPI_SOURCES) $(MAPI_GLAPI_SOURCES)
+depend: $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES)
@echo "running $(MKDEP)"
@touch depend
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(INCLUDE_DIRS) \
- -DMAPI_GLAPI_CURRENT $(GLAPI_SOURCES) $(MAPI_GLAPI_SOURCES) \
+ -DMAPI_MODE_UTIL $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES) \
2>/dev/null | sed -e 's,^$(GLAPI)/,,' -e 's,^$(MAPI)/,,' \
> depend
GLAPI_ASM_OBJECTS = $(GLAPI_ASM_SOURCES:.S=.o)
include $(MAPI)/sources.mak
-MAPI_GLAPI_OBJECTS := $(MAPI_GLAPI_SOURCES:.c=.o)
-MAPI_GLAPI_SOURCES := $(addprefix $(MAPI)/, $(MAPI_GLAPI_SOURCES))
+MAPI_UTIL_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
+MAPI_UTIL_SOURCES := $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
-TARGET_OBJECTS = $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS) $(MAPI_GLAPI_OBJECTS)
+TARGET_OBJECTS = $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS) $(MAPI_UTIL_OBJECTS)
INCLUDE_DIRS = \
-I$(TOP)/include \
@$(MKLIB) -o $(TARGET) -static $(TARGET_OBJECTS)
$(GLAPI_OBJECTS): %.o: %.c
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_GLAPI_CURRENT $< -o $@
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
$(GLAPI_ASM_OBJECTS): %.o: %.S
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
-$(MAPI_GLAPI_OBJECTS): %.o: $(MAPI)/%.c
- $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_GLAPI_CURRENT $< -o $@
+$(MAPI_UTIL_OBJECTS): %.o: $(MAPI)/%.c
+ $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
install:
-rm -f lib$(TARGET).a
-rm -f depend depend.bak
-depend: $(GLAPI_SOURCES) $(MAPI_GLAPI_SOURCES)
+depend: $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES)
@ echo "running $(MKDEP)"
@ touch depend
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(INCLUDE_DIRS) \
- -DMAPI_GLAPI_CURRENT $(GLAPI_SOURCES) $(MAPI_GLAPI_SOURCES) \
+ -DMAPI_MODE_UTIL $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES) \
2>/dev/null | sed -e 's,^$(MAPI)/,,' > depend
-include depend
env = env.Clone()
env.Append(CPPDEFINES = [
- 'MAPI_GLAPI_CURRENT',
+ 'MAPI_MODE_UTIL',
])
if env['platform'] == 'windows':
# src/mapi/mapi/sources.mak
#
-# When MAPI_GLAPI_CURRENT is defined, MAPI_GLAPI_SOURCES can be built without
-# MAPI_SOURCES and it is used by glapi.
+# mapi may be used in several ways
#
-# Otherwise, MAPI_ABI_HEADER must be defined. It should expand to the header
-# generated by mapi_abi.py.
+# - In default mode, mapi implements the interface defined by mapi.h. To use
+# this mode, compile MAPI_SOURCES.
+#
+# - In util mode, mapi provides utility functions for use with glapi. To use
+# this mode, compile MAPI_UTIL_SOURCES with MAPI_MODE_UTIL defined.
-MAPI_GLAPI_SOURCES = \
+MAPI_UTIL_SOURCES = \
u_current.c \
u_execmem.c \
u_thread.c
mapi.c \
stub.c \
table.c \
- $(MAPI_GLAPI_SOURCES)
+ $(MAPI_UTIL_SOURCES)
#include "u_current.h"
#include "u_thread.h"
-#ifndef MAPI_GLAPI_CURRENT
+#ifndef MAPI_MODE_UTIL
#include "table.h"
#include "stub.h"
#ifndef _U_CURRENT_H_
#define _U_CURRENT_H_
-#ifdef MAPI_GLAPI_CURRENT
+#ifdef MAPI_MODE_UTIL
#include "glapi/glapi.h"
#define u_current_table_tsd _gl_DispatchTSD
-#else /* MAPI_GLAPI_CURRENT */
+#else /* MAPI_MODE_UTIL */
#include "u_compiler.h"
#endif /* GLX_USE_TLS */
-#endif /* MAPI_GLAPI_CURRENT */
+#endif /* MAPI_MODE_UTIL */
void
u_current_init(void);