#!/usr/bin/make -f export DEB_BUILD_MAINT_OPTIONS = hardening=+all export DH_VERBOSE = 1 %: dh $@ override_dh_auto_clean: dh_auto_clean rm -rf build rm -rf docs/doxygen/html rm -rf docs/doxygen/xml rm -rf docs/doxygen/DoxygenWarningLog.txt rm -rf docs/sphinx/_toc.yml rm -rf test/onnx/migraphx_api_load_save_argument.msgpack override_dh_auto_configure: dh_auto_configure -- \ -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_INSTALL_RPATH=/usr/lib/${DEB_HOST_MULTIARCH}/migraphx/lib \ -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ # build missing test targets override_dh_auto_build: dh_auto_build dh_auto_build -- test_api_tf_parser test_api_array_base test_api_assign test_api_compile_options test_api_lookup test_api_custom_op \ test_api_dynamic_shape test_api_ref test_api_save_load test_api_op test_api_c_op test_api_module_construct \ # disable tests during build override_dh_auto_test: : # dwz doesn't fully support DWARF-5 yet, see #1016936 override_dh_dwz: : # generate documentation execute_after_dh_auto_build-indep: export http_proxy=127.0.0.1:9 execute_after_dh_auto_build-indep: export https_proxy=127.0.0.1:9 execute_after_dh_auto_build-indep: ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) rocm-docs-build # remove duplicate files/directories rm -rf build/html/.doctrees rm -rf build/html/_static/fonts rm -rf build/html/_static/vendor rm -rf build/html/_static/doctools.js rm -rf build/html/_static/language_data.js rm -rf build/html/_static/searchtools.js rm -rf build/html/_sphinx_design_static # Remove build path in some html files find build/html -type f -name '*.html' -exec sed -i 's|$(CURDIR)/||g' {} + endif execute_before_dh_link: ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) # remove duplicate files/directories rm -rf debian/migraphx-doc/usr/share/doc/migraphx/examples/diffusion/python_controlnet_canny_sd_15/gradio_requirements.txt rm -rf debian/migraphx-doc/usr/share/doc/migraphx/examples/diffusion/python_stable_diffusion_21/gradio_requirements.txt rm -rf debian/migraphx-doc/usr/share/doc/migraphx/examples/onnxruntime/resnet50/images rm -rf debian/migraphx-doc/usr/share/doc/migraphx/examples/transformers/python_whisper/gradio_requirements.txt endif execute_after_dh_fixperms: ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS))) # remove exec bit from sh files installed as documentation find debian/migraphx-doc -type f -name '*.sh' -exec chmod -x {} + endif # remove exec bit from test files find debian/migraphx-tests -type f -name '*.onnx' -exec chmod -x {} + find debian/migraphx-tests -type f -name '*.weight' -exec chmod -x {} + LIB=libmigraphx-c3 LIBV=$(shell head -1 debian/changelog | sed 's/.*(\(.*\)-.*).*$$/\1/') REV=$(shell head -1 debian/changelog | sed 's/.*(.*-\(.*\)).*$$/\1/') gensymbols: rm -rf /tmp/$(LIB) dpkg-deb -x ../$(LIB)_$(LIBV)-$(REV)_amd64.deb /tmp/$(LIB) dpkg-gensymbols -v$(LIBV) -p$(LIB) -P/tmp/$(LIB) -Odebian/$(LIB).symbols #Add "* Build-Depends-Package: libmigraphx-c-dev" on line 2 #sed -i '2i * Build-Depends-Package: libmigraphx-c-dev' debian/$(LIB).symbols