# parameters: # $(1): lowercase package name # $(2): uppercase package name # $(3): 32/64, build type # $(4): CROSS/, cross compile # define create-rules-meson # Don't pass CROSS here, we need a native environment and we'll handle # cross compilation below with the CROSS-prefixed variables. $(call create-rules-common,$(1),$(2),$(3)) define $(2)_MESON_CROSS$(3) cat <&2 rm -rf "$$($(2)_OBJ$(3))/meson-private/coredata.dat" echo "$$$$$(2)_MESON_CROSS$(3)" | env $$($(2)_ENV$(3)) sh >"$$($(2)_OBJ$(3))/cross-$(3).txt" env $$($(2)_ENV$(3)) \ meson "$$($(2)_OBJ$(3))" "$$($(2)_SRC)" \ --prefix="$$($(2)_DST$(3))" \ --libdir="lib$(subst 32,,$(3))" \ --buildtype=plain \ $(if $(4),--cross-file="$$($(2)_OBJ$(3))/cross-$(3).txt",) \ $$($(2)_MESON_ARGS) \ $$($(2)_MESON_ARGS$(3)) \ $$(MESON_STRIP_ARG) touch $$@ $$(OBJ)/.$(1)-build$(3): @echo ":: building $(3)bit $(1)..." >&2 env $$($(2)_ENV$(3)) \ ninja $$(filter -j%,$$(MAKEFLAGS)) -C "$$($(2)_OBJ$(3))" install $(-v?) touch $$@ endef MESON_CPU32 = x86 MESON_CPU64 = x86_64 rules-meson = $(call create-rules-meson,$(1),$(call toupper,$(1)),$(2),$(3))