File: rules

package info (click to toggle)
migraphx 7.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 31,384 kB
  • sloc: cpp: 205,073; python: 25,903; sh: 253; xml: 199; makefile: 59; ansic: 16
file content (81 lines) | stat: -rwxr-xr-x 3,086 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/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