6 include $(TOP
)/configs
/current
9 ES1_LIBS
:= libes1gallium.a libes1api.a
10 ES2_LIBS
:= libes2gallium.a libes2api.a
12 # Default rule: create ES1 and ES2 libs
13 .PHONY
: default es1 es2
14 default
: depend es1 es2
17 @
rm -f subdirs-stamp-tmp
20 @
rm -f subdirs-stamp-tmp
22 # force the inclusion of es's mfeatures.h
23 ES1_CPPFLAGS
:= -include main
/mfeatures_es1.h
-D__GL_EXPORTS
24 ES2_CPPFLAGS
:= -include main
/mfeatures_es2.h
-D__GL_EXPORTS
26 ES1_OBJ_DIR
:= objs-es1
27 ES2_OBJ_DIR
:= objs-es2
30 ES1_OBJECTS
:= $(addprefix $(ES1_OBJ_DIR
)/, $(ES1_OBJECTS
))
31 ES1_GALLIUM_OBJECTS
:= $(addprefix $(ES1_OBJ_DIR
)/, $(ES1_GALLIUM_OBJECTS
))
32 ES1_API_OBJECTS
:= $(addprefix $(ES1_OBJ_DIR
)/, $(ES1_API_OBJECTS
))
34 ES2_OBJECTS
:= $(addprefix $(ES2_OBJ_DIR
)/, $(ES2_OBJECTS
))
35 ES2_GALLIUM_OBJECTS
:= $(addprefix $(ES2_OBJ_DIR
)/, $(ES2_GALLIUM_OBJECTS
))
36 ES2_API_OBJECTS
:= $(addprefix $(ES2_OBJ_DIR
)/, $(ES2_API_OBJECTS
))
38 # compile either ES1 or ES2 sources
41 $(CC
) -c
$(CFLAGS
) $(ES
$(1)_CPPFLAGS
) $(ES
$(1)_INCLUDES
) -o
$@
$<
44 $(ES1_OBJ_DIR
)/%.o
: %.c
47 $(ES1_OBJ_DIR
)/%.o
: %.S
50 $(ES1_OBJ_DIR
)/%.o
: $(MESA
)/%.c
53 $(ES1_OBJ_DIR
)/%.o
: $(MESA
)/%.S
56 $(ES2_OBJ_DIR
)/%.o
: %.c
59 $(ES2_OBJ_DIR
)/%.o
: %.S
62 $(ES2_OBJ_DIR
)/%.o
: $(MESA
)/%.c
65 $(ES2_OBJ_DIR
)/%.o
: $(MESA
)/%.S
68 libes1.a
: $(ES1_OBJECTS
) $(GLSL_LIBS
)
69 @
$(MKLIB
) -o es1
-static
$(ES1_OBJECTS
) $(GLSL_LIBS
)
71 libes2.a
: $(ES2_OBJECTS
) $(GLSL_LIBS
)
72 @
$(MKLIB
) -o es2
-static
$(ES1_OBJECTS
) $(GLSL_LIBS
)
74 libes1gallium.a
: $(ES1_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
75 @
$(MKLIB
) -o es1gallium
-static
$(ES1_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
77 libes2gallium.a
: $(ES2_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
78 @
$(MKLIB
) -o es2gallium
-static
$(ES2_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
80 libes1api.a
: $(ES1_API_OBJECTS
)
81 @
$(MKLIB
) -o es1api
-static
$(ES1_API_OBJECTS
)
83 libes2api.a
: $(ES2_API_OBJECTS
)
84 @
$(MKLIB
) -o es2api
-static
$(ES2_API_OBJECTS
)
86 GENERATED_SOURCES
:= \
92 main
/api_exec_es1.c
: main
/APIspec.xml main
/es_generator.py main
/APIspecutil.py main
/APIspec.py
93 $(PYTHON2
) $(PYTHON_FLAGS
) main
/es_generator.py
-S main
/APIspec.xml
-V GLES1.1
> $@
95 main
/api_exec_es2.c
: main
/APIspec.xml main
/es_generator.py main
/APIspecutil.py main
/APIspec.py
96 $(PYTHON2
) $(PYTHON_FLAGS
) main
/es_generator.py
-S main
/APIspec.xml
-V GLES2.0
> $@
98 main
/get_es1.c
: main
/get_gen.py
99 $(PYTHON2
) $(PYTHON_FLAGS
) $< 1 > $@
101 main
/get_es2.c
: main
/get_gen.py
102 $(PYTHON2
) $(PYTHON_FLAGS
) $< 2 > $@
106 -rm -f
$(ES1_LIBS
) $(ES2_LIBS
)
107 -rm -rf
$(ES1_OBJ_DIR
) $(ES2_OBJ_DIR
)
108 -rm -f
$(GENERATED_SOURCES
)
109 -rm -f depend depend.bak
110 -rm -f subdirs-stamp-tmp
111 @
$(MAKE
) -C glapi
clean
117 @
$(MAKE
) -C
$(MESA
) asm_subdirs
118 @
$(MAKE
) -C
$(MESA
) glsl_builtin
120 @touch subdirs-stamp-tmp
122 # sort to avoid duplicates
123 ALL_SOURCES
:= $(sort $(ES1_ALL_SOURCES
) $(ES2_ALL_SOURCES
))
125 # need to make sure the subdirs are processed first
126 $(ALL_SOURCES
): | subdirs-stamp-tmp
128 depend
: $(ALL_SOURCES
)
129 @echo
"running $(MKDEP)"
131 @
# MESA is "..", but luckily, directories are longer than 2 characters
132 @
$(MKDEP
) -f-
-p
$(ES1_OBJ_DIR
)/ $(DEFINES
) $(ES1_CFLAGS
) \
133 $(ES1_INCLUDES
) $(ES1_ALL_SOURCES
) 2>/dev
/null | \
134 sed
-e
's,^$(ES1_OBJ_DIR)/$(MESA)/,$(ES1_OBJ_DIR)/,' > depend
135 @
$(MKDEP
) -f-
-p
$(ES2_OBJ_DIR
)/ $(DEFINES
) $(ES2_CFLAGS
) \
136 $(ES2_INCLUDES
) $(ES2_ALL_SOURCES
) 2>/dev
/null | \
137 sed
-e
's,^$(ES2_OBJ_DIR)/$(MESA)/,$(ES2_OBJ_DIR)/,' >> depend
139 ifneq ($(MAKECMDGOALS
),clean)