blob: ae74a340890005ed83f094d0296dfdfb50bcffd4 [file] [log] [blame]
FLAGS = -fPIC
ifeq (armv7-linux-androideabi,$(TARGET))
# Reset TARGET variable because armv7 target name used by Rust is not
# the same as the target name needed for the CXX toolchain.
TARGET = arm-linux-androideabi
FLAGS += -march=armv7-a -mfpu=neon --target=$(TARGET)
endif
ifneq ($(HOST),$(TARGET))
CXX ?= $(TARGET)-g++
CC ?= $(TARGET)-gcc
AR ?= $(TARGET)-ar
else
CXX ?= g++
CC ?= gcc
AR ?= ar
endif
ifeq ($(DEBUG),true)
FLAGS += -g
else
FLAGS += -O2
endif
CFLAGS += $(FLAGS)
CXXFLAGS += $(FLAGS)
CONFIGURE_FLAGS = \
--prefix=$(OUT_DIR) \
--host=$(TARGET) \
--enable-static \
--disable-shared \
--without-icu \
--without-freetype \
--without-glib \
--with-coretext=auto
all:
touch -r harfbuzz/configure $(AUTOMAKE_FILES)
cd $(OUT_DIR) && $(CARGO_MANIFEST_DIR)/harfbuzz/configure $(CONFIGURE_FLAGS) \
CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)"
cd $(OUT_DIR) && make -j$(NUM_JOBS)
cd $(OUT_DIR) && make install
# If the timestamp on these files is incorrect (because git does not preserve timestamps)
# then the configure script will incorrectly try to run automake commands to regenerate them.
# We `touch` these files to prevent this.
AUTOMAKE_FILES = $(wildcard \
harfbuzz/configure.ac \
harfbuzz/m4/*.m4 \
harfbuzz/aclocal.m4 \
harfbuzz/configure \
harfbuzz/config.h.in \
harfbuzz/Makefile.* \
harfbuzz/*/Makefile.* \
harfbuzz/*/*/Makefile.* \
harfbuzz/*/*/*/Makefile.* \
harfbuzz/*/*/*/*/Makefile.* \
harfbuzz/gtk-doc.make \
)
.PHONY: all