File: rules

package info (click to toggle)
verilator 5.032-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 93,932 kB
  • sloc: cpp: 131,288; python: 19,365; ansic: 10,234; yacc: 5,733; lex: 1,905; makefile: 1,229; sh: 489; perl: 282; fortran: 22
file content (87 lines) | stat: -rwxr-xr-x 2,464 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
82
83
84
85
86
87
#!/usr/bin/make -f
# -*- makefile -*-

#export DH_VERBOSE = 1

# Switch on the hardening
export DEB_BUILD_MAINT_OPTIONS += hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/pkg-info.mk

ifneq (,$(filter $(DEB_HOST_ARCH), mipsel))
  export DEB_CPPFLAGS_MAINT_APPEND += -g1
endif

CLEAN_OUT_DATA := \
config.log \
configure \
docs/_build \
src/config_rev.h \
verilator-config.cmake \
verilator-config-version.cmake \
verilator.pc \
$(NULL)

%:
	dh $@

override_dh_clean:
	dh_clean
	# Reset src/config_rev into the original state if needed.
	if [ -f debian/config_rev.save ]; then \
	    cp -f debian/config_rev.save src/config_rev ;\
	fi
	rm -rf $(CLEAN_OUT_DATA)

override_dh_autoreconf:
	# Work around we need to keep the original files for idempotency in case
	# we run dh_clean. The file isn't generated from "§SOMETHING".
	if [ ! -f debian/config_rev.save ]; then \
	    cp src/config_rev debian/config_rev.save ;\
	fi
	# We don't build on top of a working git tree and the build system
	# can't find a git revision. Adding a Debian version to the final
	# string instead.
	sed -i 's/UNKNOWN_REV/(Debian $(DEB_VERSION))/g' src/config_rev
	autoconf

override_dh_auto_build:
	dh_auto_build
	##########################################
	# Build sphinx based HTML documentation. #
	##########################################
	cd docs && make html
	#########################################
	# Build sphinx based PDF documentation. #
	#########################################
	cd docs && make pdf

override_dh_compress:
	dh_compress --exclude=examples --exclude=verilator.pdf

override_dh_fixperms:
	dh_fixperms
	# Fixing file permissions for Python based files in /usr/share/verilator/examples.
	for file in `find $(CURDIR)/debian/verilator/usr/share/verilator/examples -type f`; do \
		FOUND_PYTHON=$$(head -n1 $$file | grep python); \
		if [ "$$FOUND_PYTHON" != "" ]; then \
			chmod +x $$file; \
		else \
			chmod -x $$file; \
		fi; \
	done

# armel, mips{,64}el will break due libatomic issues, can be ignored for dh_auto_test.
override_dh_auto_test:
ifeq (,$(filter armel mipsel mips64el,$(DEB_BUILD_ARCH)))
	dh_auto_test
else
	@echo "#########################################"
	@echo "# Skipping calling dh_auto_test on $(DEB_BUILD_ARCH)"
	@echo "#########################################"
endif

# Ignore dwz, it's failing and does gain nothing.
override_dh_dwz: