File: rules

package info (click to toggle)
openturns 1.24-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,204 kB
  • sloc: cpp: 256,662; python: 63,381; ansic: 4,414; javascript: 406; sh: 180; xml: 164; yacc: 123; makefile: 98; lex: 55
file content (72 lines) | stat: -rwxr-xr-x 2,648 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
#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/architecture.mk

# Getting the number of jobs for the Debian build to transmit it to CMake.
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
	test_makeflags = -j$(NUMJOBS)
endif

# On riscv64, deactivating Dlib-related tests (seems to be a bug in Dlib)
ifeq ($(shell dpkg --print-architecture),riscv64)
    test_discardflags := -E \\\"Dlib_.*|OptimizationAlgorithm_std\\\"
endif

# On loong64, deactivating Dlib tests (seems to be a bug in Dlib)
ifeq ($(shell dpkg --print-architecture),loong64)
    test_discardflags := -E \\\"Dlib_.*|OptimizationAlgorithm_std\\\"
endif

# On armel, deactivating EfficientGlobalOptimization test (can be quite sensitive)
ifeq ($(shell dpkg --print-architecture),armel)
    test_discardflags := -E \\\"EfficientGlobalOptimization_std\\\"
endif

BUILD_DATE = $(shell date --utc --date="@$(SOURCE_DATE_EPOCH)" "+%a, %d %b %Y %H:%M:%S %z")

%:
	dh $@ --buildsystem=cmake --with python3

override_dh_auto_configure:
	dh_auto_configure -Bbuilddir -- \
	        -DUSE_TBB:BOOL=ON \
            -Dot_configure_date:STRING='$(BUILD_DATE)' \
            -DUSE_SPHINX:BOOL=OFF \
            -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \
            -DCMAKE_INSTALL_PREFIX:PATH=/usr \
            -DCMAKE_INSTALL_LIBDIR:PATH="/usr/lib/$(DEB_HOST_MULTIARCH)" \
            -DOPENTURNS_PYTHON_MODULE_PATH=lib/python3/dist-packages \
            -DINSTALL_DESTDIR:PATH=$(CURDIR)/debian/tmp \
	        -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=32 \
            -DSWIG_COMPILE_FLAGS:STRING='-O1'

override_dh_auto_build:
	$(MAKE) $(test_makeflags) -C builddir/lib
	$(MAKE) -j1 -C builddir/python
	$(MAKE) $(test_makeflags) -C builddir

override_dh_auto_install:
	dh_auto_install -Bbuilddir
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	eval "LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$${LD_LIBRARY_PATH}:}$(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH) \
	  CTEST_OUTPUT_ON_FAILURE=1 \
	  $(MAKE) $(test_makeflags) -C builddir test ARGS=\"$(test_makeflags) $(test_discardflags) -R pyinstallcheck\""
endif

override_dh_auto_test:
	# 'make test' does not build binary tests
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	$(MAKE) $(test_makeflags) -C builddir tests
	eval "CTEST_OUTPUT_ON_FAILURE=1 \
	  $(MAKE) -C builddir test ARGS=\"$(test_makeflags) $(test_discardflags) -R cppcheck\""
endif

override_dh_clean:
	rm -rf builddir
	dh_clean