File: rules

package info (click to toggle)
alsa-tools 1.0.16-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 11,820 kB
  • ctags: 5,229
  • sloc: ansic: 25,472; cpp: 14,137; sh: 9,710; pascal: 1,140; asm: 1,053; xml: 988; makefile: 698
file content (183 lines) | stat: -rwxr-xr-x 5,568 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
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#!/usr/bin/make -f
# -*- makefile -*-
# GNU copyright 1997 to 1999 by Joey Hess.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

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

# This has to be exported to make some magic below work.
export DH_OPTIONS

include /usr/share/quilt/quilt.make

# 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)

SUBDIRS_alsa-tools-gui = echomixer envy24control hdspconf hdspmixer rmedigicontrol
SUBDIRS_alsa-tools = ac3dec as10k1 seq/sbiload us428control
SUBDIRS_alsa-firmware-loaders = sb16_csp hdsploader mixartloader pcxhrloader sscape_ctl usx2yloader vxloader
SUBDIRS_tmp = ld10k1 qlo10k1
SUBDIRS := $(SUBDIRS_alsa-tools-gui) $(SUBDIRS_alsa-tools) $(SUBDIRS_alsa-firmware-loaders) $(SUBDIRS_tmp)
#SUBDIRS := $(SUBDIRS_tmp)
DOCS = AUTHORS README README.profiles TODO NEWS output.doc README.Debian
INSTALL_UAG := -o root -g audio


CFLAGS = -Wall -g
LDFLAGS = -Wl,-z,defs

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
	INSTALL_PROGRAM += -s
endif

#
# Common
#

autoreconf-ld10k1:
	(cd ld10k1 && autoconf && libtoolize -c --force && automake -c && $(RM) -r autom4te.cache)

autoreconf-qlo10k1:
	(cd qlo10k1 && aclocal -I ../ld10k1 && autoconf && automake -c && $(RM) -r autom4te.cache)

config: debian/stamp-patched config-stamp
config-stamp:
	dh_testdir

# qlo10k1 needs ld10k1/include/lo10k1/version.h in configure
	list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo; \
	  echo "Configuring $$subdir"; \
	  (cd $$subdir && \
	  ln -sf /usr/share/misc/config.sub . && \
	  ln -sf /usr/share/misc/config.guess . && \
	  CFLAGS="$(CFLAGS)" CXXFLAGS="$(CFLAGS)" ./configure \
	    --host=$(DEB_HOST_GNU_TYPE) \
	    --build=$(DEB_BUILD_GNU_TYPE) \
	    --prefix=/usr --mandir=\$${prefix}/share/man \
	    --infodir=\$${prefix}/share/info --datadir=\$${prefix}/share \
	    --cache-file=$(CURDIR)/config.cache \
	    --enable-static=yes \
	    --enable-dynamic=yes \
	    --with-qtdir=/usr/share/qt3 \
	    --with-ld10k1-inc-prefix=`pwd`/../ld10k1/include \
	    --with-ld10k1-prefix=`pwd`/../ld10k1/src \
	    --disable-ld10k1test &&\
	   if test $$subdir = ld10k1; then make -C include version.h; fi \
	  ); \
	done

	touch config-stamp


#Architecture 
build: build-arch

build-arch: config build-arch-stamp
build-arch-stamp:

	list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo; \
	  echo "Building $$subdir"; \
	  $(MAKE) -C $$subdir; \
	done

	touch build-arch-stamp

clean: clean-stamp unpatch
clean-stamp:
	dh_testdir
	dh_testroot

	rm -f build-arch-stamp config-stamp
	rm -f config.cache
	rm -f qlo10k1/ld10k1
	rm -f qlo10k1/include/lo10k1

	-list='$(SUBDIRS)'; for subdir in $$list; do \
	  echo; \
	  echo "Cleaning $$subdir"; \
	  $(MAKE) -C $$subdir distclean; \
	  rm -f $$subdir/config.guess; \
	  rm -f $$subdir/config.sub; \
	done

	dh_clean

# PKG = package
install-pkg:
	list='$(SUBDIRS_$(PKG))'; for subdir in $$list; do \
	  (cd $$subdir; \
	  package=$(PKG); \
	  name=`echo $$subdir | sed -e 's/^.*\///g' | sed -e 's/_/-/g'`; \
	  echo; \
	  echo "Installing $$subdir into $$name"; \
	  $(MAKE) install DESTDIR=$(CURDIR)/debian/$$package; \
	  doc_list='$(DOCS)'; for doc_file in $$doc_list; do \
	    if [ -s $$doc_file ]; then \
	      install -d $(CURDIR)/debian/$$package/usr/share/doc/$$package/$$name; \
	      install $$doc_file $(CURDIR)/debian/$$package/usr/share/doc/$$package/$$name/$$doc_file; \
	    fi; \
          done; \
	  ) \
	done

install: install-arch
install-arch: build-arch
	dh_testdir
	dh_testroot
	dh_clean -k -s 
	dh_installdirs -s

	$(MAKE) -f debian/rules PKG=alsa-tools install-pkg
	$(MAKE) -f debian/rules PKG=alsa-tools-gui install-pkg
	$(MAKE) -f debian/rules PKG=alsa-firmware-loaders install-pkg
	install $(INSTALL_UAG) -m644 debian/alsa-firmware-loaders.rules \
	debian/alsa-firmware-loaders/etc/udev/alsa-firmware-loaders.rules
	$(MAKE) -f debian/rules PKG=tmp install-pkg

# Must not depend on anything. This is to be called by binary-arch
# in another 'make' thread.
binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs debian/changelog.ALSA
	dh_installdocs --exclude=Makefile
	dh_installexamples --exclude=.cvsignore --exclude=Makefile.am --exclude=Makefile.in
	chmod 644 $(CURDIR)/debian/ld10k1/usr/share/doc/ld10k1/examples/emu10k1MIDIEffects/pontodo5
	dh_install --list-missing
	(cd debian/ld10k1/usr/bin && mv -f lo10k1 lo10k1.bin && mv -f lo10k1.sh lo10k1)
	dh_installmenu
	dh_installman
	# Unless there is a reason not to, for start sequence number N
	# it is good policy to use 100 - N as the stop sequence number.
	dh_installinit --update-rcd-params='start 19 2 3 4 5 . stop 81 0 1 6 .'
	dh_link
	dh_strip
	# Exclude .asm files because only one is over 4k, and only slightly
	dh_compress -X.asm
	dh_fixperms
	dh_makeshlibs  # --version-info='liblo10k1-0 (>= 1.0.8+1.0.9rc3-1)'
	dh_installdeb
	dh_shlibdeps -l debian/liblo10k1-0/usr/lib
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common


binary: binary-arch
.PHONY: build clean binary-arch binary install install-arch config