mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02:00
mapi: Clean up sources.mk.
Rename MAPI_GLAPI_SOURCES to MAPI_UTIL_SOURCES. Rename macro MAPI_GLAPI_CURRENT to MAPI_MODE_UTIL. Update the comments to make it clear that mapi may be used in two ways and how.
This commit is contained in:
parent
c17d4999f1
commit
7048095513
6 changed files with 29 additions and 27 deletions
|
|
@ -44,10 +44,10 @@ GLAPI_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
|
|||
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 \
|
||||
|
|
@ -72,13 +72,13 @@ lib$(ESAPI).a: $(ESAPI_OBJECTS)
|
|||
@$(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
|
||||
|
||||
|
|
@ -135,10 +135,10 @@ install: default install-headers install-pc
|
|||
$(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
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ GLAPI_OBJECTS = $(GLAPI_SOURCES:.c=.o)
|
|||
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 \
|
||||
|
|
@ -28,13 +28,13 @@ lib$(TARGET).a: $(TARGET_OBJECTS)
|
|||
@$(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:
|
||||
|
||||
|
|
@ -43,11 +43,11 @@ clean:
|
|||
-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
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ if env['platform'] != 'winddk':
|
|||
env = env.Clone()
|
||||
|
||||
env.Append(CPPDEFINES = [
|
||||
'MAPI_GLAPI_CURRENT',
|
||||
'MAPI_MODE_UTIL',
|
||||
])
|
||||
|
||||
if env['platform'] == 'windows':
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
# 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
|
||||
|
|
@ -16,4 +18,4 @@ MAPI_SOURCES = \
|
|||
mapi.c \
|
||||
stub.c \
|
||||
table.c \
|
||||
$(MAPI_GLAPI_SOURCES)
|
||||
$(MAPI_UTIL_SOURCES)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
#include "u_current.h"
|
||||
#include "u_thread.h"
|
||||
|
||||
#ifndef MAPI_GLAPI_CURRENT
|
||||
#ifndef MAPI_MODE_UTIL
|
||||
|
||||
#include "table.h"
|
||||
#include "stub.h"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef _U_CURRENT_H_
|
||||
#define _U_CURRENT_H_
|
||||
|
||||
#ifdef MAPI_GLAPI_CURRENT
|
||||
#ifdef MAPI_MODE_UTIL
|
||||
|
||||
#include "glapi/glapi.h"
|
||||
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#define u_current_table_tsd _gl_DispatchTSD
|
||||
|
||||
#else /* MAPI_GLAPI_CURRENT */
|
||||
#else /* MAPI_MODE_UTIL */
|
||||
|
||||
#include "u_compiler.h"
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ extern void *u_current_user;
|
|||
|
||||
#endif /* GLX_USE_TLS */
|
||||
|
||||
#endif /* MAPI_GLAPI_CURRENT */
|
||||
#endif /* MAPI_MODE_UTIL */
|
||||
|
||||
void
|
||||
u_current_init(void);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue