File: rules

package info (click to toggle)
nextpnr 0.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 40,064 kB
  • sloc: cpp: 176,747; python: 18,011; ansic: 10,558; pascal: 1,367; sh: 383; makefile: 223; vhdl: 44; objc: 42; tcl: 41
file content (153 lines) | stat: -rwxr-xr-x 4,338 bytes parent folder | download | duplicates (2)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk
include /usr/share/dpkg/buildopts.mk

CHANGELOG_DATE ?= $(shell LC_ALL=C date -u -d @$(SOURCE_DATE_EPOCH) +"%d %B %Y")

export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

BUILDDIR=$(CURDIR)/debian/build

ARCH=generic;ice40;ecp5;himbaechel
HIMBAECHEL_UARCH=gowin
HIMBAECHEL_GOWIN_DEVICES=all

%:
	dh $@

NO_GUI_PACKAGES = \
    -Nnextpnr-ice40-qt \
    -Nnextpnr-ecp5-qt \
    -Nnextpnr-himbaechel-qt

CMAKE_FLAGS := \
    -GNinja \
    -DCURRENT_GIT_VERSION="$(DEB_VERSION)" \
    -DBUILD_PYTHON=ON \
    -DBUILD_TESTS=ON \
    -DEXTERNAL_CHIPDB=ON \
    -DARCH='$(ARCH)' \
    -DICEBOX_DATADIR=/usr/share/fpga-icestorm/chipdb \
    -DICESTORM_INSTALL_PREFIX=/usr/share/fpga-icestorm/chipdb \
    -DTRELLIS_LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)/trellis/ \
    -DTRELLIS_DATADIR=/usr/share/trellis/ \
    -DHIMBAECHEL_UARCH=$(HIMBAECHEL_UARCH) \
    -DHIMBAECHEL_SPLIT=ON \
    -DHIMBAECHEL_GOWIN_DEVICES=$(HIMBAECHEL_GOWIN_DEVICES)

HELP2MAN_FLAGS = \
    --name="Next Generation Place and Route" \
    --version-string="$(DEB_VERSION)" \
    --section=1 \
    --manual="General Commands" \
    --no-info \
    --no-discard-stderr

override_dh_auto_clean:
	rm -rf $(BUILDDIR)
	rm -f debian/nextpnr-*.1
	dh_auto_clean

override_dh_auto_configure:
	dh_auto_configure \
		--arch \
		$(NO_GUI_PACKAGES) \
		-B$(BUILDDIR)/cli \
		-- \
		$(CMAKE_FLAGS) \
		-DBUILD_GUI=OFF \
		-DEXPORT_BBA_FILES=$(BUILDDIR)/bba
	dh_auto_configure \
		--arch \
		--remaining-packages \
		-B$(BUILDDIR)/gui \
		-- \
		$(CMAKE_FLAGS) \
		-DBUILD_GUI=ON \
		-DIMPORT_BBA_FILES=$(BUILDDIR)/bba

override_dh_auto_build:
	dh_auto_build \
		--arch \
		$(NO_GUI_PACKAGES) \
		-B$(BUILDDIR)/cli
	dh_auto_build \
		--arch \
		--remaining-packages \
		-B$(BUILDDIR)/gui

override_dh_auto_test:
	dh_auto_test \
		--arch \
		-B$(BUILDDIR)/cli
	#dh_auto_test -B$(BUILDDIR)/gui

override_dh_auto_install:
	dh_auto_install \
		--arch \
		$(NO_GUI_PACKAGES) \
		-B$(BUILDDIR)/cli \
		--destdir=debian/tmp/cli
	dh_auto_install \
		--arch \
		--remaining-packages \
		-B$(BUILDDIR)/gui \
		--destdir=debian/tmp/gui

override_dh_install:
	dh_install \
		--arch \
		$(NO_GUI_PACKAGES) \
		--sourcedir=debian/tmp/cli
	dh_install \
		--arch \
		--remaining-packages \
		--sourcedir=debian/tmp/gui
	mkdir -p debian/nextpnr-generic/usr/share/man/man1/
	[ ! -x debian/nextpnr-generic/usr/bin/nextpnr-generic ] || \
	help2man \
		$(HELP2MAN_FLAGS) \
		debian/nextpnr-generic/usr/bin/nextpnr-generic \
		> debian/nextpnr-generic/usr/share/man/man1/nextpnr-generic.1
	mkdir -p debian/nextpnr-ice40/usr/share/man/man1/
	[ ! -x debian/nextpnr-ice40/usr/bin/nextpnr-ice40 ] || \
	help2man \
		$(HELP2MAN_FLAGS) \
		debian/nextpnr-ice40/usr/bin/nextpnr-ice40 \
		> debian/nextpnr-ice40/usr/share/man/man1/nextpnr-ice40.1
	mkdir -p debian/nextpnr-ecp5/usr/share/man/man1/
	[ ! -x debian/nextpnr-ecp5/usr/bin/nextpnr-ecp5 ] || \
	help2man \
		$(HELP2MAN_FLAGS) \
		debian/nextpnr-ecp5/usr/bin/nextpnr-ecp5 \
		> debian/nextpnr-ecp5/usr/share/man/man1/nextpnr-ecp5.1
	mkdir -p debian/nextpnr-himbaechel/usr/share/man/man1/
	[ ! -x debian/nextpnr-himbaechel/usr/bin/nextpnr-himbaechel-gowin ] || \
	help2man \
		$(HELP2MAN_FLAGS) \
		debian/nextpnr-himbaechel/usr/bin/nextpnr-himbaechel-gowin \
		> debian/nextpnr-himbaechel/usr/share/man/man1/nextpnr-himbaechel-gowin.1
	mkdir -p debian/nextpnr-ice40-qt/usr/share/man/man1/
	[ ! -x debian/nextpnr-ice40-qt/usr/bin/nextpnr-ice40 ] || \
	help2man \
		$(HELP2MAN_FLAGS) \
		debian/nextpnr-ice40-qt/usr/bin/nextpnr-ice40 \
		> debian/nextpnr-ice40-qt/usr/share/man/man1/nextpnr-ice40.1
	mkdir -p debian/nextpnr-ecp5-qt/usr/share/man/man1/
	[ ! -x debian/nextpnr-ecp5-qt/usr/bin/nextpnr-ecp5 ] || \
	help2man \
		$(HELP2MAN_FLAGS) \
		debian/nextpnr-ecp5-qt/usr/bin/nextpnr-ecp5 \
		> debian/nextpnr-ecp5-qt/usr/share/man/man1/nextpnr-ecp5.1
	mkdir -p debian/nextpnr-himbaechel-qt/usr/share/man/man1/
	[ ! -x debian/nextpnr-himbaechel-qt/usr/bin/nextpnr-himbaechel-gowin ] || \
	help2man \
		$(HELP2MAN_FLAGS) \
		debian/nextpnr-himbaechel-qt/usr/bin/nextpnr-himbaechel-gowin \
		> debian/nextpnr-himbaechel-qt/usr/share/man/man1/nextpnr-himbaechel-gowin.1

override_dh_installexamples:
	dh_installexamples --exclude=.gitignore