summaryrefslogtreecommitdiff
path: root/Android.mk
blob: 86ed610c3388e6ac596207f594fc510dd50b1d5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

WAYLAND_TOP := $(LOCAL_PATH)

WAYLAND_BUILT_MAKEFILES := \
	$(WAYLAND_TOP)/src/Android.mk \
	$(WAYLAND_TOP)/src/Android-scanner.mk \
	$(WAYLAND_TOP)/cursor/Android.mk

# Generated tools needed to create BUILT_SOURCES of src/Makefile.am.
$(WAYLAND_TOP)/src/Android.mk: $(HOST_OUT_EXECUTABLES)/wayland-scanner$(HOST_EXECUTABLE_SUFFIX)

# Any final product file from ./configure will do.
WAYLAND_CONFIGURE_TARGET := $(WAYLAND_TOP)/src/Makefile

$(WAYLAND_CONFIGURE_TARGET): $(CONFIGURE_DEPENDENCIES) \
			$(call intermediates-dir-for,STATIC_LIBRARIES,libexpat,HOST,)/libexpat.a \
			$(CONTRIB_ROOT)/libffi/libffi.mk \
			$(WAYLAND_TOP)/configure.ac \
			$(WAYLAND_TOP)/src/Makefile.am \
			$(WAYLAND_TOP)/cursor/Makefile.am
	cd $(WAYLAND_TOP) && autoreconf -fiv
	cd $(WAYLAND_TOP) && \
		CC="$(CONFIGURE_CC)" \
		CFLAGS="$(CONFIGURE_CFLAGS)" \
		LD=$(TARGET_LD) \
		LDFLAGS="$(CONFIGURE_LDFLAGS)" \
		CPP=$(CONFIGURE_CPP) \
		CPPFLAGS="$(CONFIGURE_CPPFLAGS) -I$(abspath $(TOPDIR)external/expat/lib)" \
		PKG_CONFIG_LIBDIR=$(CONFIGURE_PKG_CONFIG_LIBDIR) \
		./configure \
			--host=arm-linux-androideabi \
			--disable-scanner \
			--with-icondir=/system/usr/share/cursors \
			--disable-documentation

$(WAYLAND_BUILT_MAKEFILES): $(WAYLAND_CONFIGURE_TARGET)
	make -C $(dir $@) $(notdir $@)

.PHONY: wayland-reset wayland-clean

wayland-reset:
	cd $(WAYLAND_TOP) && \
	git clean -qdxf && \
	git reset --hard HEAD

wayland-clean:

contrib-reset: wayland-reset
contrib-clean: wayland-clean

CONFIGURE_PKG_CONFIG_LIBDIR := $(CONFIGURE_PKG_CONFIG_LIBDIR):$(abspath $(WAYLAND_TOP)/src):$(abspath $(WAYLAND_TOP)/cursor)

# This trick forces make to create and read in Android-scanner.mk before
# it tried to build wayland-scanner. Without this, the first clean 'make'
# would fail with missing wayland-scanner.
ifeq ($(wildcard $(WAYLAND_TOP)/src/Android-scanner.mk),)
include $(WAYLAND_TOP)/src/Android-scanner.mk
else
include $(WAYLAND_BUILT_MAKEFILES)
endif