diff options
author | Chia-I Wu <[email protected]> | 2009-09-21 17:57:57 +0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-11-05 20:04:20 -0700 |
commit | bfa66bd6f941920cf32ce79fb103c3755b4dd8fb (patch) | |
tree | 180a41b8262fc3d6dd80ad498889fd65dd260b49 /src/mesa/es/Makefile | |
parent | f68bf0621d1f865033b078191c1f4ec1fa0bbc5c (diff) |
mesa/es: Add OpenGL ES overlay.
This is primitive support for OpenGL ES. It uses a subset of mesa
sources to build libesXgallium.a and libesXapi.a, where X is 1 for
OpenGL ES 1.x, 2 for OpenGL ES 2.x. The static libraries serve the same
purpose as libmesagallium.a and libglapi.a do for OpenGL.
This is based on the work of opengl-es branch.
Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/mesa/es/Makefile')
-rw-r--r-- | src/mesa/es/Makefile | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/src/mesa/es/Makefile b/src/mesa/es/Makefile new file mode 100644 index 00000000000..42347d0b079 --- /dev/null +++ b/src/mesa/es/Makefile @@ -0,0 +1,125 @@ +# src/mesa/es/Makefile +# +TOP := ../../.. +MESA := .. + +include $(TOP)/configs/current +include sources.mak + +ES1_LIBS := libes1gallium.a libes1api.a +ES2_LIBS := libes2gallium.a libes2api.a + +# Default rule: create ES1 and ES2 libs +.PHONY: default +default: subdirs depend es1 es2 + +es1: $(ES1_LIBS) + +es2: $(ES2_LIBS) + +# force the inclusion of es's mfeatures.h +ES1_CPPFLAGS := -include main/mfeatures_es1.h -D__GL_EXPORTS +ES2_CPPFLAGS := -include main/mfeatures_es2.h -D__GL_EXPORTS + +ES1_OBJ_DIR := objs-es1 +ES2_OBJ_DIR := objs-es2 + +# adjust output dirs +ES1_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_OBJECTS)) +ES1_GALLIUM_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_GALLIUM_OBJECTS)) +ES1_API_OBJECTS := $(addprefix $(ES1_OBJ_DIR)/, $(ES1_API_OBJECTS)) + +ES2_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_OBJECTS)) +ES2_GALLIUM_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_GALLIUM_OBJECTS)) +ES2_API_OBJECTS := $(addprefix $(ES2_OBJ_DIR)/, $(ES2_API_OBJECTS)) + +# compile either ES1 or ES2 sources +define es-compile + @mkdir -p $(dir $@) + $(CC) -c $(CFLAGS) $(ES$(1)_CPPFLAGS) $(ES$(1)_INCLUDES) -o $@ $< +endef + +$(ES1_OBJ_DIR)/%.o: %.c + $(call es-compile,1) + +$(ES1_OBJ_DIR)/%.o: %.S + $(call es-compile,1) + +$(ES1_OBJ_DIR)/%.o: $(MESA)/%.c + $(call es-compile,1) + +$(ES1_OBJ_DIR)/%.o: $(MESA)/%.S + $(call es-compile,1) + +$(ES2_OBJ_DIR)/%.o: %.c + $(call es-compile,2) + +$(ES2_OBJ_DIR)/%.o: %.S + $(call es-compile,2) + +$(ES2_OBJ_DIR)/%.o: $(MESA)/%.c + $(call es-compile,2) + +$(ES2_OBJ_DIR)/%.o: $(MESA)/%.S + $(call es-compile,2) + +libes1.a: $(ES1_OBJECTS) + @$(TOP)/bin/mklib -o es1 -static $(ES1_OBJECTS) + +libes2.a: $(ES2_OBJECTS) + @$(TOP)/bin/mklib -o es2 -static $(ES1_OBJECTS) + +libes1gallium.a: $(ES1_GALLIUM_OBJECTS) + @$(TOP)/bin/mklib -o es1gallium -static $(ES1_GALLIUM_OBJECTS) + +libes2gallium.a: $(ES2_GALLIUM_OBJECTS) + @$(TOP)/bin/mklib -o es2gallium -static $(ES2_GALLIUM_OBJECTS) + +libes1api.a: $(ES1_API_OBJECTS) + @$(TOP)/bin/mklib -o es1api -static $(ES1_API_OBJECTS) + +libes2api.a: $(ES2_API_OBJECTS) + @$(TOP)/bin/mklib -o es2api -static $(ES2_API_OBJECTS) + +GENERATED_SOURCES := \ + main/api_exec_es1.c \ + main/api_exec_es2.c \ + main/get_es1.c \ + main/get_es2.c + +main/api_exec_es1.c: main/APIspec.txt main/es_generator.py main/apiutil.py main/es1_special + $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.txt -V GLES1.1 > $@ + +main/api_exec_es2.c: main/APIspec.txt main/es_generator.py main/apiutil.py main/es2_special + $(PYTHON2) $(PYTHON_FLAGS) main/es_generator.py -S main/APIspec.txt -V GLES2.0 > $@ + +main/get_es1.c: main/get_gen.py + $(PYTHON2) $(PYTHON_FLAGS) $< 1 > $@ + +main/get_es2.c: main/get_gen.py + $(PYTHON2) $(PYTHON_FLAGS) $< 2 > $@ + +.PHONY: clean +clean: + -rm -f $(ES1_LIBS) $(ES2_LIBS) + -rm -rf $(ES1_OBJ_DIR) $(ES2_OBJ_DIR) + -rm -f $(GENERATED_SOURCES) + -rm -f depend + -rm -f *~ + +subdirs: + make -C glapi + make -C $(MESA) asm_subdirs + +depend: $(ES1_ALL_SOURCES) $(ES2_ALL_SOURCES) + @echo "running $(MKDEP)" + @touch depend + @# MESA is "..", but luckily, directories are longer than 2 characters + @$(MKDEP) -f- -p$(ES1_OBJ_DIR)/ $(DEFINES) $(ES1_CFLAGS) \ + $(ES1_INCLUDES) $(ES1_ALL_SOURCES) 2>/dev/null | \ + sed -e 's,^$(ES1_OBJ_DIR)/$(MESA)/,$(ES1_OBJ_DIR)/,' > depend + @$(MKDEP) -f- -p$(ES2_OBJ_DIR)/ $(DEFINES) $(ES2_CFLAGS) \ + $(ES2_INCLUDES) $(ES2_ALL_SOURCES) 2>/dev/null | \ + sed -e 's,^$(ES2_OBJ_DIR)/$(MESA)/,$(ES2_OBJ_DIR)/,' >> depend + +-include depend |