File: rules

package info (click to toggle)
examl 3.0.22-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 3,120 kB
  • sloc: ansic: 27,325; makefile: 73; sh: 48
file content (83 lines) | stat: -rwxr-xr-x 2,999 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
#!/usr/bin/make -f

# DH_VERBOSE := 1
export LC_ALL=C.UTF-8

export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_CFLAGS_MAINT_APPEND=-fopenmp-simd -O3 -DSIMDE_ENABLE_OPENMP
include /usr/share/dpkg/default.mk

SRCDIR:=examl
prefix=$(CURDIR)/debian/$(DEB_SOURCE)/usr

%:
	dh $@  --sourcedirectory=$(SRCDIR)

override_dh_auto_clean:
ifeq (amd64,$(DEB_HOST_ARCH))
	for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 ; do \
		dh_auto_clean -- SFX=-$${SIMD} ; \
	done
	$(MAKE) --directory=parser -f Makefile.SSE3.gcc clean
else ifeq (i386,$(DEB_HOST_ARCH))
	for SIMD in ssse3 sse3 sse2 sse mmx; do \
		dh_auto_clean -- SFX=-$${SIMD} ; \
		$(MAKE) --directory=parser -f Makefile.SSE3.gcc SFX=-$${SIMD} clean ; \
	done
	dh_auto_clean
	$(MAKE) --directory=parser -f Makefile.SSE3.gcc clean
else
	dh_auto_clean
	$(MAKE) --directory=parser -f Makefile.SSE3.gcc clean
endif

override_dh_auto_build:
	dh_auto_build
ifeq (amd64,$(DEB_HOST_ARCH))
	for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 ; do \
		$(MAKE) --directory=$(SRCDIR) -f Makefile.AVX.gcc SFX=-$${SIMD} CFLAGS="$(CFLAGS) -m$${SIMD}" ; \
		$(MAKE) --directory=$(SRCDIR) -f Makefile.OMP.AVX.gcc SFX=-$${SIMD} CFLAGS="$(CFLAGS) -m$${SIMD}" ; \
		find . -name '*.o' -delete ; \
	done
	$(MAKE) --directory=parser -f Makefile.SSE3.gcc
else ifeq (i386,$(DEB_HOST_ARCH))
	for SIMD in ssse3 sse3 sse2 sse mmx; do \
		$(MAKE) --directory=$(SRCDIR) -f Makefile.AVX.gcc SFX=-$${SIMD} CFLAGS="$(CFLAGS) -m$${SIMD}" ; \
		$(MAKE) --directory=$(SRCDIR) -f Makefile.OMP.AVX.gcc SFX=-$${SIMD} CFLAGS="$(CFLAGS) -m$${SIMD}" ; \
		find . -name '*.o' -delete ; \
	done
	for SIMD in sse mmx; do \
		$(MAKE) --directory=parser -f Makefile.SSE3.gcc SFX=-$${SIMD} CFLAGS="$(CFLAGS) -m$${SIMD}" ; \
		find . -name '*.o' -delete ; \
	done
	$(MAKE) --directory=$(SRCDIR) -f Makefile.AVX.gcc
	$(MAKE) --directory=$(SRCDIR) -f Makefile.OMP.AVX.gcc
	$(MAKE) --directory=parser -f Makefile.SSE3.gcc
else
	$(MAKE) --directory=$(SRCDIR) -f Makefile.AVX.gcc
	$(MAKE) --directory=$(SRCDIR) -f Makefile.OMP.AVX.gcc
	$(MAKE) --directory=parser -f Makefile.SSE3.gcc
endif

override_dh_auto_install:
ifeq (amd64,$(DEB_HOST_ARCH))
	dh_install debian/bin/simd-dispatch /usr/lib/$(DEB_SOURCE)/bin
	dh_install examl/examl* /usr/lib/$(DEB_SOURCE)/bin/
	dh_install parser/parse-examl /usr/bin/
	mkdir -p $(prefix)/bin
	cd $(prefix)/bin \
		&& for prog in examl examl-OMP ; do \
		ln -s ../lib/$(DEB_SOURCE)/bin/simd-dispatch $${prog} ; done
else ifeq (i386,$(DEB_HOST_ARCH))
	dh_install debian/bin/simd-dispatch /usr/lib/$(DEB_SOURCE)/bin
	dh_install examl/examl* parser/parse-examl* /usr/lib/$(DEB_SOURCE)/bin/
	mkdir -p $(prefix)/bin
	cd $(prefix)/bin \
		&& for prog in examl examl-OMP parse-examl ; do \
		ln -s ../lib/$(DEB_SOURCE)/bin/simd-dispatch $${prog} ; done
else
	dh_install examl/{examl,examl-OMP} parser/parse-examl /usr/bin/
endif

override_dh_gencontrol:
	dh_gencontrol -- -Vsimde:Built-Using="$(shell dpkg-query -f '$${source:Package} (= $${source:Version}), ' -W "libsimde-dev")"