File: rules

package info (click to toggle)
creduce 2.10.0%2B20220116-1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 5,172 kB
  • sloc: cpp: 25,272; ansic: 7,233; sh: 4,918; perl: 3,003; makefile: 593; lex: 441
file content (56 lines) | stat: -rwxr-xr-x 1,430 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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

CLANG_V	= 13
#ifneq (,$(filter $(DEB_HOST_ARCH), armel armhf))
#  CLANG_V=9
#else
#  CLANG_V=11
#endif
CLANG	= clang-$(CLANG_V)
GCC	= gcc

ifneq (,$(filter $(DEB_HOST_ARCH),armel))
  export LIBATOMIC = -latomic
endif

%:
	dh $@  --with autoreconf --parallel

override_dh_auto_configure:
	dh_auto_configure -- --with-llvm=/usr/lib/llvm-$(CLANG_V) CLANG_FORMAT=clang-format-$(CLANG_V)
	
override_dh_auto_build:
	dh_auto_build

ifeq ($(DEB_HOST_ARCH),$(DEB_BUILD_ARCH))
	if which help2man >/dev/null 2>&1; then \
	  v=$$(creduce/creduce --help| awk '/^creduce/ { print $$2 }'); \
	  help2man --no-info --name='C and C++ program reducer' --version-string=$$v creduce/creduce > debian/creduce.1; \
	fi
endif

override_dh_auto_test:
# these are time consuming ...
ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
  ifeq (,$(filter $(DEB_HOST_ARCH),m68k sh4 s390 sparc))
	if grep -q '^  *frama-c-base' debian/control; then \
	  cd tests && CLANG="$(CLANG)" GCC="$(GCC)" ./run_tests; \
	else \
	  echo "Cannot run the tests, frama-c-base not in build dependencies."; \
	fi
  endif
endif

override_dh_auto_install:
	dh_auto_install
	install -D -m 644 debian/creduce.1 debian/creduce/usr/share/man/man1/creduce.1

override_dh_auto_clean:
	rm -rf tests/tmp_*
	dh_auto_clean