| 1 |
#!/usr/bin/make -f |
| 2 |
|
| 3 |
-include /usr/share/dpkg/buildtools.mk |
| 4 |
|
| 5 |
static_lib = libb64.a |
| 6 |
shared_lib = libb64.so |
| 7 |
soversion = 0d |
| 8 |
soname = $(shared_lib).$(soversion) |
| 9 |
|
| 10 |
libdir = /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/ |
| 11 |
|
| 12 |
cflags = \ |
| 13 |
$(shell dpkg-buildflags --get CFLAGS) \ |
| 14 |
$(shell dpkg-buildflags --get CPPFLAGS) |
| 15 |
ldflags = $(shell dpkg-buildflags --get LDFLAGS) -Wl,-z,now |
| 16 |
|
| 17 |
.PHONY: build build-indep build-arch |
| 18 |
build build-arch: build-stamp |
| 19 |
|
| 20 |
build-stamp: debian/control Makefile |
| 21 |
dh_testdir |
| 22 |
rm -rf src-shlib/ |
| 23 |
cp -a src src-shlib/ |
| 24 |
cd src-shlib/ && rm -f *.o *.a |
| 25 |
CFLAGS="$(cflags)" LDFLAGS="$(ldflags)" dh_auto_build |
| 26 |
CFLAGS="$(cflags) -fPIC" dh_auto_build --sourcedirectory=src-shlib/ |
| 27 |
cd src-shlib && $(CC) $(ldflags) -shared -Wl,-soname,$(soname) *.o -o $(soname) |
| 28 |
cd src-shlib && ln -sf $(soname) $(shared_lib) |
| 29 |
ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" "" |
| 30 |
debian/tests/libb64-dev --build-time |
| 31 |
endif |
| 32 |
touch $(@) |
| 33 |
|
| 34 |
.PHONY: binary binary-indep binary-arch |
| 35 |
binary binary-arch: debian/control build-stamp |
| 36 |
dh_testdir |
| 37 |
dh_testroot |
| 38 |
dh_prep |
| 39 |
dh_install -p libb64-dev src/$(static_lib) $(libdir) |
| 40 |
dh_install -p libb64-dev src-shlib/$(shared_lib) $(libdir) |
| 41 |
dh_install -p libb64-dev include/* /usr/include/ |
| 42 |
dh_install -p libb64-$(soversion) src-shlib/$(soname) $(libdir) |
| 43 |
dh_installdocs AUTHORS BENCHMARKS README |
| 44 |
dh_installchangelogs CHANGELOG |
| 45 |
dh_compress |
| 46 |
dh_fixperms |
| 47 |
dh_strip |
| 48 |
dh_makeshlibs -- -c4 |
| 49 |
dh_shlibdeps |
| 50 |
dh_installdeb |
| 51 |
dh_gencontrol |
| 52 |
dh_md5sums |
| 53 |
dh_builddeb |
| 54 |
|
| 55 |
.PHONY: clean |
| 56 |
clean: debian/control Makefile |
| 57 |
$(MAKE) clean |
| 58 |
rm -rf src-shlib/ |
| 59 |
dh_clean */depend |
| 60 |
|
| 61 |
here = $(dir $(firstword $(MAKEFILE_LIST)))/.. |
| 62 |
debian_version = $(word 2,$(shell cd $(here) && dpkg-parsechangelog | grep ^Version:)) |
| 63 |
upstream_version = $(firstword $(subst -, ,$(debian_version))) |
| 64 |
|
| 65 |
.PHONY: get-orig-source |
| 66 |
get-orig-source: |
| 67 |
sh $(here)/debian/get-orig-source.sh $(upstream_version) |
| 68 |
|
| 69 |
# vim:ts=4 sw=4 noet |