File: rules

package info (click to toggle)
picolibc 1.8.11-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 50,064 kB
  • sloc: ansic: 404,031; asm: 24,984; sh: 2,585; python: 2,289; perl: 680; pascal: 329; exp: 287; makefile: 222; cpp: 71; xml: 40
file content (93 lines) | stat: -rwxr-xr-x 3,042 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
88
89
90
91
92
93
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
export DH_VERBOSE = 1

# Don't let dpkg-buildflags mess with the compiler settings
export DEB_CPPFLAGS_MAINT_SET =
export DEB_CXXFLAGS_MAINT_SET =
export DEB_CFLAGS_MAINT_SET =
export DEB_LDFLAGS_MAINT_SET =

BUILDDIR=build

DEBPATH=$(shell pwd)/debian
BUILDPATH=$(DEBPATH)/$(BUILDDIR)

%:
	dh $@ -B$(BUILDDIR)

RISCV_ARCH=riscv64-unknown-elf
ARM_ARCH=arm-none-eabi
LX106_ARCH=xtensa-lx106-elf
AARCH64_ARCH=aarch64-none-elf

MESON_SHARED_C_ARGS = -Wdate-time -ffile-prefix-map=$(BUILDPATH)=. -fdebug-prefix-map=$(BUILDPATH)=.

MESON_SHARED_FLAGS = --prefix=/usr -Ddebug=true -Dsystem-libc=true --buildtype=release

MESON_RISCV_FLAGS = \
	$(MESON_SHARED_FLAGS) \
	-Dtests=true \
	-Dc_args='$(MESON_SHARED_C_ARGS) -msave-restore' \
	--cross-file scripts/cross-$(RISCV_ARCH).txt \
	-Dspecsdir=/usr/$(RISCV_ARCH)/lib \
	-Dincludedir=$(RISCV_ARCH)/include \
	-Dlibdir=$(RISCV_ARCH)/lib

MESON_ARM_FLAGS = \
	$(MESON_SHARED_FLAGS) \
	-Dc_args='$(MESON_SHARED_C_ARGS)' \
	-Dtests=true \
	--cross-file scripts/cross-$(ARM_ARCH).txt \
	-Dspecsdir=/usr/$(ARM_ARCH)/lib \
	-Dincludedir=$(ARM_ARCH)/include \
	-Dlibdir=$(ARM_ARCH)/lib

MESON_LX106_FLAGS = \
	$(MESON_SHARED_FLAGS) \
	-Dc_args='$(MESON_SHARED_C_ARGS)' \
	--cross-file scripts/cross-$(LX106_ARCH).txt \
	-Dspecsdir=/usr/lib/$(LX106_ARCH) \
	-Dincludedir=lib/$(LX106_ARCH)/include \
	-Dlibdir=lib/$(LX106_ARCH)/lib

MESON_AARCH64_FLAGS = \
	$(MESON_SHARED_FLAGS) \
	-Dc_args='$(MESON_SHARED_C_ARGS)' \
	-Dtests=true \
	--cross-file scripts/cross-$(AARCH64_ARCH).txt \
	-Dspecsdir=/usr/$(AARCH64_ARCH)/lib \
	-Dincludedir=$(AARCH64_ARCH)/include \
	-Dlibdir=$(AARCH64_ARCH)/lib

override_dh_autoreconf:
	echo 'no reconf needed'

override_dh_auto_clean:
	rm -fr debian/$(BUILDDIR)

override_dh_auto_configure:
	meson setup . debian/$(BUILDDIR)/$(AARCH64_ARCH) $(MESON_AARCH64_FLAGS)
	meson setup . debian/$(BUILDDIR)/$(ARM_ARCH) $(MESON_ARM_FLAGS)
	meson setup . debian/$(BUILDDIR)/$(LX106_ARCH) $(MESON_LX106_FLAGS)
	meson setup . debian/$(BUILDDIR)/$(RISCV_ARCH) $(MESON_RISCV_FLAGS)

override_dh_auto_build:
	cd debian/$(BUILDDIR)/$(AARCH64_ARCH) && ninja -v
	cd debian/$(BUILDDIR)/$(ARM_ARCH) && ninja -v
	cd debian/$(BUILDDIR)/$(LX106_ARCH) && ninja -v
	cd debian/$(BUILDDIR)/$(RISCV_ARCH) && ninja -v

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	cd debian/$(BUILDDIR)/$(AARCH64_ARCH) && meson test --timeout-multiplier=10
	cd debian/$(BUILDDIR)/$(ARM_ARCH) && meson test --timeout-multiplier=10
	cd debian/$(BUILDDIR)/$(RISCV_ARCH) && meson test --timeout-multiplier=10
endif

override_dh_auto_install:
	cd debian/$(BUILDDIR)/$(AARCH64_ARCH) && DESTDIR=${CURDIR}/debian/tmp ninja install
	cd debian/$(BUILDDIR)/$(ARM_ARCH) && DESTDIR=${CURDIR}/debian/tmp ninja install
	cd debian/$(BUILDDIR)/$(LX106_ARCH) && DESTDIR=${CURDIR}/debian/tmp ninja install
	cd debian/$(BUILDDIR)/$(RISCV_ARCH) && DESTDIR=${CURDIR}/debian/tmp ninja install