#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = reproducible=+fixfilepath

%:
	dh $@

ifeq (,$(filter $(DEB_HOST_ARCH), armel mipsel m68k powerpc riscv64 sh4))
OTF2_ENABLE=-DVITE_ENABLE_OTF2=ON
endif

# Adding CPPFLAGS by hand until #653916 is fixed
override_dh_auto_configure:
	dh_auto_configure -- -DVITE_ENABLE_OTF=ON $(OTF2_ENABLE) \
		-DVITE_ENABLE_MT_PARSERS=ON \
		-DVITE_ENABLE_VBO=OFF \
		-DCMAKE_CXX_COMPILER_ARG1="$(CPPFLAGS)" \
		-DUSE_QT5=ON

override_dh_auto_build:
	dh_auto_build
	FORCE_SOURCE_DATE=1 $(MAKE) -C docs/user_manual
	FORCE_SOURCE_DATE=1 $(MAKE) -C docs/technical_manual

override_dh_auto_clean:
	$(MAKE) -C docs/user_manual clean
	$(MAKE) -C docs/technical_manual clean
	dh_auto_clean
