1 # src/mapi/es1api/Makefile
4 include $(TOP
)/configs
/current
6 # this Makefile can build both OpenGL ES 1.1 and 2.0
11 esapi_PC
:= glesv1_cm.
pc
13 esapi_LIB
:= $(GLESv1_CM_LIB
)
14 esapi_LIB_NAME
:= $(GLESv1_CM_LIB_NAME
)
15 esapi_LIB_GLOB
:= $(GLESv1_CM_LIB_GLOB
)
16 esapi_LIB_DEPS
:= $(GLESv1_CM_LIB_DEPS
)
24 esapi_LIB
:= $(GLESv2_LIB
)
25 esapi_LIB_NAME
:= $(GLESv2_LIB_NAME
)
26 esapi_LIB_GLOB
:= $(GLESv2_LIB_GLOB
)
27 esapi_LIB_DEPS
:= $(GLESv2_LIB_DEPS
)
35 GLAPI
:= $(TOP
)/src
/mapi
/glapi
36 MAPI
:= $(TOP
)/src
/mapi
/mapi
41 -DMAPI_ABI_HEADER
=\"$(ESAPI
)/glapi_mapi_tmp.h
\"
43 include $(MAPI
)/sources.mak
44 esapi_SOURCES
:= $(addprefix $(MAPI
)/, $(MAPI_BRIDGE_SOURCES
))
45 esapi_OBJECTS
:= $(MAPI_BRIDGE_SOURCES
:.c
=.o
)
46 esapi_CPPFLAGS
+= -DMAPI_MODE_BRIDGE
48 esapi_LIB_DEPS
:= -L
$(TOP
)/$(LIB_DIR
) -l
$(GLAPI_LIB
) $(esapi_LIB_DEPS
)
51 default
: depend
$(TOP
)/$(LIB_DIR
)/$(esapi_LIB_NAME
)
53 $(TOP
)/$(LIB_DIR
)/$(esapi_LIB_NAME
): $(esapi_OBJECTS
)
54 $(MKLIB
) -o
$(esapi_LIB
) -linker
'$(CC)' -ldflags '$(LDFLAGS)' \
55 -major
$(esapi_LIB_MAJOR
) \
56 -minor
$(esapi_LIB_MINOR
) \
57 -patch
$(esapi_LIB_PATCH
) \
58 -id
$(INSTALL_LIB_DIR
)/lib
$(esapi_LIB
).
$(esapi_LIB_MAJOR
).dylib \
59 $(MKLIB_OPTIONS
) -install $(TOP
)/$(LIB_DIR
) \
60 $(esapi_OBJECTS
) $(esapi_LIB_DEPS
)
62 # not used, but kept for completeness
63 lib
$(ESAPI
).a
: $(esapi_OBJECTS
)
64 @
$(MKLIB
) -o
$(ESAPI
) -static
$(esapi_OBJECTS
)
66 $(esapi_OBJECTS
): %.o
: $(MAPI
)/%.c
67 $(CC
) -c
$(esapi_CPPFLAGS
) $(CFLAGS
) $< -o
$@
69 $(esapi_SOURCES
): glapi_mapi_tmp.h
71 include $(GLAPI
)/gen
/glapi_gen.mk
72 glapi_mapi_tmp.h
: $(GLAPI
)/gen
/gl_and_es_API.xml
$(glapi_gen_mapi_deps
)
73 $(call glapi_gen_mapi
,$<,$(ESAPI
))
78 -rm -f
$(TOP
)/$(LIB_DIR
)/$(esapi_LIB_NAME
)
80 -rm -f
$(esapi_OBJECTS
)
81 -rm -f depend depend.bak
82 -rm -f glapi_mapi_tmp.h
85 -e
's,@INSTALL_DIR@,$(INSTALL_DIR),' \
86 -e
's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
87 -e
's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
88 -e
's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
92 -e
's,@GLESv1_CM_PC_REQ_PRIV@,$(GLESv1_CM_PC_REQ_PRIV),' \
93 -e
's,@GLESv1_CM_PC_LIB_PRIV@,$(GLESv1_CM_PC_LIB_PRIV),' \
94 -e
's,@GLESv1_CM_PC_CFLAGS@,$(GLESv1_CM_PC_CFLAGS),' \
95 -e
's,@GLESv1_CM_LIB@,$(GLESv1_CM_LIB),'
99 -e
's,@GLESv2_PC_REQ_PRIV@,$(GLESv2_PC_REQ_PRIV),' \
100 -e
's,@GLESv2_PC_LIB_PRIV@,$(GLESv2_PC_LIB_PRIV),' \
101 -e
's,@GLESv2_PC_CFLAGS@,$(GLESv2_PC_CFLAGS),' \
102 -e
's,@GLESv2_LIB@,$(GLESv2_LIB),'
104 $(esapi_PC
): $(esapi_PC
).in
105 @sed
$(pcedit-
$(ES
)) $< > $@
108 $(INSTALL
) -d
$(DESTDIR
)$(INSTALL_INC_DIR
)/$(esapi_HEADER
)
109 $(INSTALL
) -m
644 $(TOP
)/include/$(esapi_HEADER
)/*.h \
110 $(DESTDIR
)$(INSTALL_INC_DIR
)/$(esapi_HEADER
)
112 install-pc
: $(esapi_PC
)
113 $(INSTALL
) -d
$(DESTDIR
)$(INSTALL_LIB_DIR
)/pkgconfig
114 $(INSTALL
) -m
644 $(esapi_PC
) $(DESTDIR
)$(INSTALL_LIB_DIR
)/pkgconfig
116 install: default install-headers install-pc
117 $(INSTALL
) -d
$(DESTDIR
)$(INSTALL_LIB_DIR
)
118 $(MINSTALL
) $(TOP
)/$(LIB_DIR
)/$(esapi_LIB_GLOB
) \
119 $(DESTDIR
)$(INSTALL_LIB_DIR
)
121 # workaround a bug in makedepend
122 makedepend_CPPFLAGS
:= \
123 $(filter-out -DMAPI_ABI_HEADER
=%, $(esapi_CPPFLAGS
))
124 $(esapi_OBJECTS
): glapi_mapi_tmp.h
126 depend
: $(esapi_SOURCES
)
127 @echo
"running $(MKDEP)"
129 @
$(MKDEP
) $(MKDEP_OPTIONS
) -f-
$(DEFINES
) $(makedepend_CPPFLAGS
) \
130 $(esapi_SOURCES
) 2>/dev
/null | \
131 sed
-e
's,^$(GLAPI)/,,' -e
's,^$(MAPI)/,,' > depend