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
|
DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS= --build $(DEB_BUILD_GNU_TYPE)
endif
source = $(shell grep "^Source: " debian/control|head -1|sed 's/Source: \(.*\)/\1/g')
version = $(shell grep "^$(source) " debian/changelog|head -1 |sed 's/.*(\(.*\)\-[^\-]*).*/\1/g')
major=0
ifeq ($(version),1.7)
ifeq ($(DEB_HOST_ARCH),m68k)
version = 1.7-4
endif
endif
cflags = `dpkg-buildflags --get CFLAGS` `dpkg-buildflags --get CPPFLAGS`
cflags += -Wall -W -D_GNU_SOURCE -D_REENTRANT
cflags_udeb = -Os -Wall -W -g -D_GNU_SOURCE -D_REENTRANT
ldflags = `dpkg-buildflags --get LDFLAGS`
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
install = install
else
install = install-strip
endif
objdir = $(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)
objdir_udeb = $(objdir)-udeb
configure: configure-deb-stamp configure-udeb-stamp
autoreconf-stamp:
dh_autoreconf
touch $@
configure-deb-stamp: autoreconf-stamp
dh_testdir
mkdir $(objdir)
cd $(objdir) && \
../configure --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) --prefix=/usr --mandir=/usr/share/man --enable-shared $(CROSS)
touch $@
configure-udeb-stamp: autoreconf-stamp
dh_testdir
mkdir $(objdir_udeb)
cd $(objdir_udeb) && \
../configure --prefix=/usr --mandir=/usr/share/man --enable-shared $(CROSS)
touch $@
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: build-arch-deb-stamp build-arch-udeb-stamp
build-arch-deb-stamp: configure-deb-stamp
dh_testdir
cd $(objdir) && $(MAKE) CFLAGS="$(cflags)" LDFLAGS="$(ldflags)"
touch $@
build-arch-udeb-stamp: configure-udeb-stamp
dh_testdir
cd $(objdir_udeb) && $(MAKE) CFLAGS="$(cflags_udeb)"
touch $@
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp config.log
rm -f config.log
rm -f build-arch-deb-stamp build-arch-udeb-stamp
rm -f autoreconf-stamp configure-deb-stamp configure-udeb-stamp
rm -f po/*.gmo po/stamp-po
rm -rf $(objdir) $(objdir_udeb)
rm -rf $(CURDIR)/debian/tmp $(CURDIR)/debian/tmp-udeb
rm -f $(CURDIR)/debian/libpopt0.install
rm -f $(CURDIR)/debian/libpopt0.links
rm -f $(CURDIR)/debian/libpopt-dev.links
[ ! -f Makefile ] || $(MAKE) distclean
dh_autoreconf_clean
dh_clean
rm -rf $(CURDIR)/tmp
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
cd $(objdir) && \
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
cd $(objdir_udeb) && \
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp-udeb
mkdir $(CURDIR)/debian/tmp-udeb/lib/
mv $(CURDIR)/debian/tmp-udeb/usr/lib*/libpopt.so.* \
$(CURDIR)/debian/tmp-udeb/lib/
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
sh debian/preprocess
dh_install --list-missing
dh_installdocs
dh_installexamples
dh_installman
dh_installchangelogs CHANGES
dh_link
dh_strip
dh_compress
dh_fixperms
dh_makeshlibs -V "libpopt0 (>= $(version))" -plibpopt0 --add-udeb="libpopt0-udeb"
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
|