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 ES1_CPPFLAGS
:= -DFEATURE_ES1
=1 -D__GL_EXPORTS
23 ES2_CPPFLAGS
:= -DFEATURE_ES2
=1 -D__GL_EXPORTS
25 ES1_OBJ_DIR
:= objs-es1
26 ES2_OBJ_DIR
:= objs-es2
29 ES1_OBJECTS
:= $(addprefix $(ES1_OBJ_DIR
)/, $(ES1_OBJECTS
))
30 ES1_GALLIUM_OBJECTS
:= $(addprefix $(ES1_OBJ_DIR
)/, $(ES1_GALLIUM_OBJECTS
))
31 ES1_API_OBJECTS
:= $(addprefix $(ES1_OBJ_DIR
)/, $(ES1_API_OBJECTS
))
33 ES2_OBJECTS
:= $(addprefix $(ES2_OBJ_DIR
)/, $(ES2_OBJECTS
))
34 ES2_GALLIUM_OBJECTS
:= $(addprefix $(ES2_OBJ_DIR
)/, $(ES2_GALLIUM_OBJECTS
))
35 ES2_API_OBJECTS
:= $(addprefix $(ES2_OBJ_DIR
)/, $(ES2_API_OBJECTS
))
37 # compile either ES1 or ES2 sources
40 $(CC
) -c
$(CFLAGS
) $(ES
$(1)_CPPFLAGS
) $(ES
$(1)_INCLUDES
) -o
$@
$<
43 $(ES1_OBJ_DIR
)/%.o
: %.c
46 $(ES1_OBJ_DIR
)/%.o
: %.S
49 $(ES1_OBJ_DIR
)/%.o
: $(MESA
)/%.c
52 $(ES1_OBJ_DIR
)/%.o
: $(MESA
)/%.S
55 $(ES2_OBJ_DIR
)/%.o
: %.c
58 $(ES2_OBJ_DIR
)/%.o
: %.S
61 $(ES2_OBJ_DIR
)/%.o
: $(MESA
)/%.c
64 $(ES2_OBJ_DIR
)/%.o
: $(MESA
)/%.S
67 libes1.a
: $(ES1_OBJECTS
) $(GLSL_LIBS
)
68 @
$(MKLIB
) -o es1
-static
$(ES1_OBJECTS
) $(GLSL_LIBS
)
70 libes2.a
: $(ES2_OBJECTS
) $(GLSL_LIBS
)
71 @
$(MKLIB
) -o es2
-static
$(ES1_OBJECTS
) $(GLSL_LIBS
)
73 libes1gallium.a
: $(ES1_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
74 @
$(MKLIB
) -o es1gallium
-static
$(ES1_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
76 libes2gallium.a
: $(ES2_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
77 @
$(MKLIB
) -o es2gallium
-static
$(ES2_GALLIUM_OBJECTS
) $(GLSL_LIBS
)
79 libes1api.a
: $(ES1_API_OBJECTS
)
80 @
$(MKLIB
) -o es1api
-static
$(ES1_API_OBJECTS
)
82 libes2api.a
: $(ES2_API_OBJECTS
)
83 @
$(MKLIB
) -o es2api
-static
$(ES2_API_OBJECTS
)
85 GENERATED_SOURCES
:= \
91 main
/api_exec_es1.c
: main
/APIspec.xml main
/es_generator.py main
/APIspecutil.py main
/APIspec.py
92 $(PYTHON2
) $(PYTHON_FLAGS
) main
/es_generator.py
-S main
/APIspec.xml
-V GLES1.1
> $@
94 main
/api_exec_es2.c
: main
/APIspec.xml main
/es_generator.py main
/APIspecutil.py main
/APIspec.py
95 $(PYTHON2
) $(PYTHON_FLAGS
) main
/es_generator.py
-S main
/APIspec.xml
-V GLES2.0
> $@
97 main
/get_es1.c
: main
/get_gen.py
98 $(PYTHON2
) $(PYTHON_FLAGS
) $< 1 > $@
100 main
/get_es2.c
: main
/get_gen.py
101 $(PYTHON2
) $(PYTHON_FLAGS
) $< 2 > $@
105 -rm -f
$(ES1_LIBS
) $(ES2_LIBS
)
106 -rm -rf
$(ES1_OBJ_DIR
) $(ES2_OBJ_DIR
)
107 -rm -f
$(GENERATED_SOURCES
)
108 -rm -f depend depend.bak
109 -rm -f subdirs-stamp-tmp
110 @
$(MAKE
) -C glapi
clean
116 @
$(MAKE
) -C
$(MESA
) asm_subdirs
117 @
$(MAKE
) -C
$(MESA
) glsl_builtin
119 @touch subdirs-stamp-tmp
121 # sort to avoid duplicates
122 ALL_SOURCES
:= $(sort $(ES1_ALL_SOURCES
) $(ES2_ALL_SOURCES
))
124 # need to make sure the subdirs are processed first
125 $(ALL_SOURCES
): | subdirs-stamp-tmp
127 depend
: $(ALL_SOURCES
)
128 @echo
"running $(MKDEP)"
130 @
# MESA is "..", but luckily, directories are longer than 2 characters
131 @
$(MKDEP
) -f-
-p
$(ES1_OBJ_DIR
)/ $(DEFINES
) $(ES1_CFLAGS
) \
132 $(ES1_INCLUDES
) $(ES1_ALL_SOURCES
) 2>/dev
/null | \
133 sed
-e
's,^$(ES1_OBJ_DIR)/$(MESA)/,$(ES1_OBJ_DIR)/,' > depend
134 @
$(MKDEP
) -f-
-p
$(ES2_OBJ_DIR
)/ $(DEFINES
) $(ES2_CFLAGS
) \
135 $(ES2_INCLUDES
) $(ES2_ALL_SOURCES
) 2>/dev
/null | \
136 sed
-e
's,^$(ES2_OBJ_DIR)/$(MESA)/,$(ES2_OBJ_DIR)/,' >> depend
138 ifneq ($(MAKECMDGOALS
),clean)