File: rules

package info (click to toggle)
rakarrack 0.6.1-5
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 10,136 kB
  • sloc: cpp: 27,705; sh: 794; makefile: 377
file content (126 lines) | stat: -rwxr-xr-x 3,195 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/make -f
# Derived from:
# Sample debian/rules that uses debhelper,
# GNU copyright 1997 by Joey Hess.
# Copyright Ron Lee 2003, 2004, 2007, 2008

SHELL = /bin/bash
include /usr/share/quilt/quilt.make

#export DH_VERBOSE=1
export DH_OPTIONS

ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

DEB_HOST_ARCH_CPU  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU)


builddir            = build
builddir_sse        = build-sse

all_builds  = $(builddir) $(builddir_sse)
arch_builds = $(builddir)

ifeq ($(DEB_HOST_ARCH_CPU),i386)
arch_builds += $(builddir_sse)
endif


clean:
	dh_testdir
	dh_testroot
	$(RM) *-stamp
	$(RM) -r $(all_builds) config.log
	dh_clean


# This first empty one is equivalent to declaring it .SECONDARY while we have
# no target specific variables to set.  We don't want it removed by default as
# an unnamed intermediate file when the build target is completed.
$(builddir)/config.status:
$(builddir_sse)/config.status:        EXTRA_CONFIG_FLAGS += --enable-sse

%/config.status: configure
	dh_testdir
	mkdir -p $*
	$(RM) src/config.h
	cd $* && ../configure --host=$(DEB_HOST_GNU_TYPE)	\
			      --build=$(DEB_BUILD_GNU_TYPE)	\
			      --prefix=/usr			\
			      $(EXTRA_CONFIG_FLAGS)

build: build-arch

build-arch: $(foreach d,$(arch_builds),build-target-$(d)-stamp)
build-target-%-stamp : %/config.status
	dh_testdir
	cd $* && $(MAKE)
	touch $@

build-indep: build-indep-stamp
build-indep-stamp:
	dh_testdir
	touch $@


install: install-arch install-indep

install-arch: install-arch-stamp
install-arch-stamp:
	dh_testdir
	cd $(builddir) && $(MAKE) install DESTDIR=$(CURDIR)/debian/rakarrack
	find $(CURDIR)/debian/rakarrack/ -name "COPYING" -depth -exec rm -rf {} \;
	mv $(CURDIR)/debian/rakarrack/usr/share/doc/rakarrack/ChangeLog $(CURDIR)/debian/rakarrack/usr/share/doc/rakarrack/changelog
	if [ -d "$(builddir_sse)" ]; then								  \
	    mkdir -p $(CURDIR)/debian/rakarrack/usr/lib/rakarrack/sse; \
	    cp -v $(builddir)/src/rakarrack    $(CURDIR)/debian/rakarrack/usr/lib/rakarrack; \
	    cp -v $(builddir_sse)/src/rakarrack    $(CURDIR)/debian/rakarrack/usr/lib/rakarrack/sse; \
	    cp -v $(CURDIR)/debian/rakarrack.wrapper    $(CURDIR)/debian/rakarrack/usr/bin/rakarrack; \
	fi
	touch $@

install-indep:


binary: binary-indep binary-arch

binary-indep: DH_OPTIONS = -i
binary-indep: build-indep install-indep
	dh_testdir
	dh_testroot
	dh_installdocs
	dh_installchangelogs
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build-arch install-arch
	dh_testdir
	dh_testroot
	dh_install -a
	dh_installdocs -a
	dh_installman -a
	dh_installchangelogs -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a


.PHONY: clean build build-arch build-indep install install-arch install-indep \
	binary binary-arch binary-indep