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
:= \
89 main
/get_es1.c
: main
/get_gen.py
90 $(PYTHON2
) $(PYTHON_FLAGS
) $< 1 > $@
92 main
/get_es2.c
: main
/get_gen.py
93 $(PYTHON2
) $(PYTHON_FLAGS
) $< 2 > $@
97 -rm -f
$(ES1_LIBS
) $(ES2_LIBS
)
98 -rm -rf
$(ES1_OBJ_DIR
) $(ES2_OBJ_DIR
)
99 -rm -f
$(GENERATED_SOURCES
)
100 -rm -f depend depend.bak
101 -rm -f subdirs-stamp-tmp
102 @
$(MAKE
) -C glapi
clean
108 @
$(MAKE
) -C
$(MESA
) asm_subdirs
109 @
$(MAKE
) -C
$(MESA
) glsl_builtin
111 @touch subdirs-stamp-tmp
113 # sort to avoid duplicates
114 ALL_SOURCES
:= $(sort $(ES1_ALL_SOURCES
) $(ES2_ALL_SOURCES
))
116 # need to make sure the subdirs are processed first
117 $(ALL_SOURCES
): | subdirs-stamp-tmp
119 depend
: $(ALL_SOURCES
)
120 @echo
"running $(MKDEP)"
122 @
# MESA is "..", but luckily, directories are longer than 2 characters
123 @
$(MKDEP
) -f-
-p
$(ES1_OBJ_DIR
)/ $(DEFINES
) $(ES1_CFLAGS
) \
124 $(ES1_INCLUDES
) $(ES1_ALL_SOURCES
) 2>/dev
/null | \
125 sed
-e
's,^$(ES1_OBJ_DIR)/$(MESA)/,$(ES1_OBJ_DIR)/,' > depend
126 @
$(MKDEP
) -f-
-p
$(ES2_OBJ_DIR
)/ $(DEFINES
) $(ES2_CFLAGS
) \
127 $(ES2_INCLUDES
) $(ES2_ALL_SOURCES
) 2>/dev
/null | \
128 sed
-e
's,^$(ES2_OBJ_DIR)/$(MESA)/,$(ES2_OBJ_DIR)/,' >> depend
130 ifneq ($(MAKECMDGOALS
),clean)