File: rules

package info (click to toggle)
raxml 8.2.9%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 3,092 kB
  • ctags: 1,889
  • sloc: ansic: 57,717; perl: 125; makefile: 39; sh: 33
file content (58 lines) | stat: -rwxr-xr-x 1,900 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
#!/usr/bin/make -f

# Copyright (C) Andreas Tille <tille@debian.org>
# License: GPL

# export DEB_BUILD_MAINT_OPTIONS = hardening=+all # does not build
export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie

DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
exe=raxmlHPC

##MFILES:=Makefile.gcc \ # we use a wrapper to the faster versions instead of shipping the "plain" version
MFILES:=Makefile.PTHREADS.gcc \
	Makefile.SSE3.PTHREADS.gcc \
	Makefile.AVX.PTHREADS.gcc

BINDIR=$(CURDIR)/debian/tmpbuild

# Package does not build when this option is set
# export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

override_dh_auto_clean:
	for mfile in $(MFILES); do $(MAKE) -f $${mfile} clean ; done
	rm -rf $(BINDIR)

override_dh_auto_build:
	mkdir -p $(BINDIR)
	for mfile in $(MFILES); do \
	    $(MAKE) -f $${mfile} ; \
	    curexe=`ls $(exe)* | head -n 1` ; \
	    if [ -e $(BINDIR)/$${curexe} ] ; then \
		echo "**** ERROR: $${curexe} was created before!!" && false ; \
	    else \
		mv $${curexe} $(BINDIR)/$${curexe} ; \
	    fi ; \
	    $(MAKE) -f $${mfile} clean ; \
	done

override_dh_installman:
	help2man --no-info --help-option="-h" --version-option="-v" \
	         --name="Randomized Axelerated Maximum Likelihood" \
	         $(CURDIR)/debian/$(DEBPKGNAME)/usr/bin/$(exe) > $(CURDIR)/debian/$(DEBPKGNAME)/usr/share/man/man1/$(exe).1
	for cexe in `ls $(BINDIR)/$(exe)*` ; do \
	    curexe=`basename $${cexe}` ; \
	    if [ $${curexe} != $(exe) ] ; then \
		ln -s $(exe).1.gz $(CURDIR)/debian/$(DEBPKGNAME)/usr/share/man/man1/$${curexe}.1.gz ; \
	    fi ; \
	done

override_dh_installexamples:
	dh_installexamples
	# fix perl path in example scripts
	for pscript in `ls usefulScripts/*.pl` ; do \
	    sed 's?/usr/local/bin/perl?/usr/bin/perl?' $${pscript} > $(CURDIR)/debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/examples/`basename $${pscript}` ; \
	done