| 1 | #!/usr/bin/make -f |
|---|
| 2 | |
|---|
| 3 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
|---|
| 4 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | CFLAGS = -Wall -g |
|---|
| 8 | |
|---|
| 9 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
|---|
| 10 | CFLAGS += -O0 |
|---|
| 11 | else |
|---|
| 12 | CFLAGS += -O2 |
|---|
| 13 | endif |
|---|
| 14 | |
|---|
| 15 | PATCH_DIR := debian/patches |
|---|
| 16 | |
|---|
| 17 | patch: patch-stamp |
|---|
| 18 | patch-stamp: |
|---|
| 19 | dh_testdir |
|---|
| 20 | # apply patches |
|---|
| 21 | QUILT_PATCHES=$(PATCH_DIR) \ |
|---|
| 22 | quilt --quiltrc /dev/null push -a || test $$? = 2 |
|---|
| 23 | touch $@ |
|---|
| 24 | |
|---|
| 25 | configure: configure-stamp |
|---|
| 26 | configure-stamp: patch-stamp |
|---|
| 27 | dh_testdir |
|---|
| 28 | CFLAGS="$(CFLAGS) -Wl,-z,defs" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info |
|---|
| 29 | touch configure-stamp |
|---|
| 30 | |
|---|
| 31 | build: build-stamp |
|---|
| 32 | build-stamp: |
|---|
| 33 | dh_testdir |
|---|
| 34 | $(MAKE) |
|---|
| 35 | touch build-stamp |
|---|
| 36 | |
|---|
| 37 | clean: |
|---|
| 38 | dh_testdir |
|---|
| 39 | dh_testroot |
|---|
| 40 | [ ! -f Makefile ] || $(MAKE) distclean |
|---|
| 41 | # unapply patches, if any |
|---|
| 42 | QUILT_PATCHES=$(PATCH_DIR) \ |
|---|
| 43 | quilt --quiltrc /dev/null pop -a -R || test $$? = 2 |
|---|
| 44 | -rm -rf .pc |
|---|
| 45 | rm -f install-stamp build-stamp configure-stamp patch-stamp |
|---|
| 46 | rm -f build-stamp |
|---|
| 47 | rm -rf config.cache |
|---|
| 48 | dh_clean |
|---|
| 49 | |
|---|
| 50 | install: build |
|---|
| 51 | dh_testdir |
|---|
| 52 | dh_testroot |
|---|
| 53 | dh_clean -k |
|---|
| 54 | dh_installdirs |
|---|
| 55 | $(MAKE) install DESTDIR=$(CURDIR)/debian/xfardic |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | # Build architecture-independent files here. |
|---|
| 59 | binary-indep: build install |
|---|
| 60 | # We have nothing to do by default. |
|---|
| 61 | |
|---|
| 62 | # Build architecture-dependent files here. |
|---|
| 63 | binary-arch: build install |
|---|
| 64 | dh_testdir |
|---|
| 65 | dh_testroot |
|---|
| 66 | dh_installchangelogs ChangeLog |
|---|
| 67 | dh_installdocs |
|---|
| 68 | dh_link |
|---|
| 69 | dh_strip |
|---|
| 70 | dh_compress |
|---|
| 71 | dh_fixperms |
|---|
| 72 | dh_installdeb |
|---|
| 73 | dh_shlibdeps |
|---|
| 74 | dh_gencontrol |
|---|
| 75 | dh_md5sums |
|---|
| 76 | dh_builddeb |
|---|
| 77 | |
|---|
| 78 | binary: binary-indep binary-arch |
|---|
| 79 | .PHONY: patch build clean binary-indep binary-arch binary install |
|---|