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 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# 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
# 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)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) \
LDFLAGS="-L/usr/$(DEB_HOST_GNU_TYPE)/lib"
else
CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif
CFLAGS = -Wall -g
CFLAGS_UDEB = $(CFLAGS) -Os
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
INSTALL_PROGRAM += -s
endif
objdir = $(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)
objdir_udeb = $(objdir)-udeb
configure: configure-deb-stamp configure-udeb-stamp
configure-common: configure-common-stamp
configure-common-stamp:
dh_testdir
# apply patches
QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null push -a || test $$? = 2
# make sure this file doesn't exist!
rm -f $(CURDIR)/usb.h
# update config.guess and config.sub
cp -f /usr/share/misc/config.sub config.sub
cp -f /usr/share/misc/config.guess config.guess
touch $@
configure-deb: configure-deb-stamp
configure-deb-stamp: configure-common-stamp
dh_testdir
# make build directory
mkdir $(objdir)
# run configure with build tree $(objdir)
cd $(objdir) && \
CFLAGS="$(CFLAGS)" ../configure $(CROSS) \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info
touch $@
configure-udeb: configure-udeb-stamp
configure-udeb-stamp: configure-common-stamp
dh_testdir
# make build directory
mkdir $(objdir_udeb)
# run configure with build tree $(objdir_udeb)
cd $(objdir_udeb) && \
CFLAGS="$(CFLAGS_UDEB)" ../configure $(CROSS) \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--disable-build-docs
touch $@
build: build-arch build-indep
build-arch: build-arch-deb build-arch-udeb
build-arch-deb: build-arch-deb-stamp
build-arch-deb-stamp: configure-deb-stamp
dh_testdir
cd $(objdir) && \
$(MAKE)
touch $@
build-arch-udeb: build-arch-udeb-stamp
build-arch-udeb-stamp: configure-udeb-stamp
dh_testdir
cd $(objdir_udeb) && \
$(MAKE)
touch $@
build-indep: build-indep-stamp
build-indep-stamp:
dh_testdir
touch $@
clean:
dh_testdir
dh_testroot
rm -f *-stamp
rm -f config.sub config.guess
# Remove build trees
rm -rf $(objdir) $(objdir_udeb)
# Remove patches
QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null pop -a || test $$? = 2
rm -rf .pc
# Remove install dirs
rm -rf $(CURDIR)/debian/tmp $(CURDIR)/debian/tmp-udeb
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k -s
dh_installdirs -s
# Main install
cd $(objdir) && \
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
# Move the library to /lib
mkdir $(CURDIR)/debian/tmp/lib/
mv $(CURDIR)/debian/tmp/usr/lib/libusb-0.1.so.* \
$(CURDIR)/debian/tmp/lib/
ln -sf /lib/libusb-0.1.so.4 $(CURDIR)/debian/tmp/usr/lib/libusb-0.1.so.4
ln -sf /lib/libusb-0.1.so.4.4.4 $(CURDIR)/debian/tmp/usr/lib/libusb.so
# Move all files in their corresponding package
dh_install -s -Nlibusb-0.1-udeb --list-missing --sourcedir=debian/tmp
# udeb install
$(MAKE) -C $(objdir_udeb) install DESTDIR=$(CURDIR)/debian/tmp-udeb
# Move the library to /lib
mkdir $(CURDIR)/debian/tmp-udeb/lib/
mv $(CURDIR)/debian/tmp-udeb/usr/lib/libusb-0.1.so.* \
$(CURDIR)/debian/tmp-udeb/lib/
dh_install -plibusb-0.1-udeb --sourcedir=debian/tmp-udeb
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
# dh_installexamples
# dh_installmenu
dh_installdebconf
# dh_installlogrotate
# dh_installemacsen
# dh_installpam
# dh_installmime
# dh_installinit
# dh_installcron
# dh_installinfo
dh_installman
dh_link -s
dh_strip -s
dh_compress -s
dh_fixperms -s
# dh_perl
# dh_python
dh_makeshlibs -V -plibusb-0.1-4 --add-udeb="libusb-0.1-udeb"
dh_makeshlibs -V -plibusb++-0.1-4c2
dh_installdeb -s
dh_shlibdeps -s
dh_gencontrol -s
dh_md5sums -s
dh_builddeb -s
binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install configure
|