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
37 # directory for generated sources/headers
43 -DMAPI_ABI_HEADER
=\"$(ESAPI
)/glapi_mapi_tmp.h
\"
45 include $(MAPI
)/sources.mak
46 esapi_SOURCES
:= $(addprefix $(MAPI
)/, $(MAPI_BRIDGE_SOURCES
))
47 esapi_OBJECTS
:= $(MAPI_BRIDGE_SOURCES
:.c
=.o
)
48 esapi_CPPFLAGS
+= -DMAPI_MODE_BRIDGE
50 esapi_LIB_DEPS
:= -L
$(TOP
)/$(LIB_DIR
) -l
$(GLAPI_LIB
) $(esapi_LIB_DEPS
)
53 default
: depend
$(TOP
)/$(LIB_DIR
)/$(esapi_LIB_NAME
)
55 $(TOP
)/$(LIB_DIR
)/$(esapi_LIB_NAME
): $(esapi_OBJECTS
)
56 $(MKLIB
) -o
$(esapi_LIB
) -linker
'$(CC)' -ldflags '$(LDFLAGS)' \
57 -major
$(esapi_LIB_MAJOR
) \
58 -minor
$(esapi_LIB_MINOR
) \
59 -patch
$(esapi_LIB_PATCH
) \
60 -id
$(INSTALL_LIB_DIR
)/lib
$(esapi_LIB
).
$(esapi_LIB_MAJOR
).dylib \
61 $(MKLIB_OPTIONS
) -install $(TOP
)/$(LIB_DIR
) \
62 $(esapi_OBJECTS
) $(esapi_LIB_DEPS
)
64 # not used, but kept for completeness
65 lib
$(ESAPI
).a
: $(esapi_OBJECTS
)
66 @
$(MKLIB
) -o
$(ESAPI
) -static
$(esapi_OBJECTS
)
68 $(esapi_OBJECTS
): %.o
: $(MAPI
)/%.c
69 $(CC
) -c
$(esapi_CPPFLAGS
) $(CFLAGS
) $< -o
$@
71 $(esapi_SOURCES
): | glapi-stamp
75 @
# generate sources/headers
76 @
$(MAKE
) -C
$(GLAPI
)/gen-es
$(ES
)
82 -rm -f
$(TOP
)/$(LIB_DIR
)/$(esapi_LIB_NAME
)
84 -rm -f
$(esapi_OBJECTS
)
85 -rm -f depend depend.bak
87 @
# clean generated sources/headers
88 @
$(MAKE
) -C
$(GLAPI
)/gen-es clean-
$(ES
)
91 -e
's,@INSTALL_DIR@,$(INSTALL_DIR),' \
92 -e
's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
93 -e
's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
94 -e
's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
98 -e
's,@GLESv1_CM_PC_REQ_PRIV@,$(GLESv1_CM_PC_REQ_PRIV),' \
99 -e
's,@GLESv1_CM_PC_LIB_PRIV@,$(GLESv1_CM_PC_LIB_PRIV),' \
100 -e
's,@GLESv1_CM_PC_CFLAGS@,$(GLESv1_CM_PC_CFLAGS),' \
101 -e
's,@GLESv1_CM_LIB@,$(GLESv1_CM_LIB),'
105 -e
's,@GLESv2_PC_REQ_PRIV@,$(GLESv2_PC_REQ_PRIV),' \
106 -e
's,@GLESv2_PC_LIB_PRIV@,$(GLESv2_PC_LIB_PRIV),' \
107 -e
's,@GLESv2_PC_CFLAGS@,$(GLESv2_PC_CFLAGS),' \
108 -e
's,@GLESv2_LIB@,$(GLESv2_LIB),'
110 $(esapi_PC
): $(esapi_PC
).in
111 @sed
$(pcedit-
$(ES
)) $< > $@
114 $(INSTALL
) -d
$(DESTDIR
)$(INSTALL_INC_DIR
)/$(esapi_HEADER
)
115 $(INSTALL
) -m
644 $(TOP
)/include/$(esapi_HEADER
)/*.h \
116 $(DESTDIR
)$(INSTALL_INC_DIR
)/$(esapi_HEADER
)
118 install-pc
: $(esapi_PC
)
119 $(INSTALL
) -d
$(DESTDIR
)$(INSTALL_LIB_DIR
)/pkgconfig
120 $(INSTALL
) -m
644 $(esapi_PC
) $(DESTDIR
)$(INSTALL_LIB_DIR
)/pkgconfig
122 install: default install-headers install-pc
123 $(INSTALL
) -d
$(DESTDIR
)$(INSTALL_LIB_DIR
)
124 $(MINSTALL
) $(TOP
)/$(LIB_DIR
)/$(esapi_LIB_GLOB
) \
125 $(DESTDIR
)$(INSTALL_LIB_DIR
)
127 depend
: $(esapi_SOURCES
)
128 @echo
"running $(MKDEP)"
130 @
$(MKDEP
) $(MKDEP_OPTIONS
) -f-
$(DEFINES
) $(esapi_CPPFLAGS
) \
131 $(esapi_SOURCES
) 2>/dev
/null | \
132 sed
-e
's,^$(GLAPI)/,,' -e
's,^$(MAPI)/,,' > depend