harfbuzz-sys 0.1.13

Rust bindings to the HarfBuzz text shaping engine
Documentation
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
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 \
	--without-icu \
	--without-freetype \
	--without-glib

ifeq ("apple-darwin",$(findstring "apple-darwin",$(TARGET)))
	CONFIGURE_FLAGS += --with-coretext
endif

all:
	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

.PHONY: all