#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -std=gnu11
export DEB_CXXFLAGS_MAINT_APPEND  = -std=gnu++14

include /usr/share/dpkg/architecture.mk

# The script JIT (COMPILECODEASM) emits x86-64 machine code: keep it on amd64
# only, and use the bytecode interpreter elsewhere. X64 selects 64-bit pointers.
ifeq ($(DEB_HOST_ARCH),amd64)
ARCH_DEFINES = -DINTEL -DCOMPILECODEASM -DX64
else ifeq ($(DEB_HOST_ARCH_BITS),64)
ARCH_DEFINES = -DX64
else
ARCH_DEFINES =
endif

# wx-config of the host architecture, needed when cross-building
WX_CONFIG = $(firstword $(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/wx/config/gtk3-unicode-3.*) wx-config)

%:
	dh $@ --sourcedirectory=Player

override_dh_auto_build:
	dh_auto_build -- ARCH_DEFINES="$(ARCH_DEFINES)" WX_CONFIG="$(WX_CONFIG)"
