Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | #!/usr/bin/make -f |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 2 | # Made with the aid of dh_make, by Craig Small |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 3 | # Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. |
| 4 | # Some lines taken from debmake, by Cristoph Lameter. |
| 5 | |
| 6 | # Uncomment this to turn on verbose mode. |
| 7 | #export DH_VERBOSE=1 |
| 8 | |
| 9 | # These are used for cross-compiling and for saving the configure script |
| 10 | # from having to guess our platform (since we know it already) |
| 11 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 12 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 13 | |
| 14 | CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion |
| 15 | CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic |
| 16 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 17 | NCURSES_PKG = ncurses-examples |
| 18 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 19 | TARGET = i686-w64-mingw32 |
| 20 | MINGW_BIN = /usr/bin |
| 21 | MINGW_TOP = /usr/$(TARGET) |
| 22 | MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses-examples |
| 23 | |
| 24 | CFLAGS = $(CC_NORMAL) |
| 25 | |
| 26 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 27 | CFLAGS += -O0 |
| 28 | else |
| 29 | CFLAGS += -O2 |
| 30 | endif |
| 31 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 32 | INSTALL_PROGRAM += -s |
| 33 | endif |
| 34 | |
| 35 | |
| 36 | configure: configure-stamp |
| 37 | configure-stamp: |
| 38 | dh_testdir |
| 39 | |
| 40 | CFLAGS="$(CFLAGS)" ./configure \ |
| 41 | --host=$(TARGET) \ |
| 42 | --target=$(TARGET) \ |
| 43 | --prefix=$(MINGW_TOP) \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 44 | --bindir=\$${prefix}/bin/$(NCURSES_PKG) \ |
| 45 | --datadir=\$${prefix}/share/$(NCURSES_PKG) \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 46 | --with-screen=ncursesw6 \ |
| 47 | --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig |
| 48 | |
| 49 | touch configure-stamp |
| 50 | |
| 51 | build: build-stamp |
| 52 | build-stamp: configure-stamp |
| 53 | dh_testdir |
| 54 | |
| 55 | $(MAKE) |
| 56 | |
| 57 | touch build-stamp |
| 58 | |
| 59 | clean: |
| 60 | dh_testdir |
| 61 | dh_testroot |
| 62 | |
| 63 | [ ! -f makefile ] || $(MAKE) distclean |
| 64 | |
| 65 | rm -f configure-stamp build-stamp install-stamp |
| 66 | |
| 67 | dh_clean |
| 68 | |
| 69 | install: install-stamp |
| 70 | install-stamp: build-stamp |
| 71 | dh_testdir |
| 72 | dh_testroot |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 73 | dh_prep |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 74 | dh_installdirs |
| 75 | |
| 76 | $(MAKE) install DESTDIR=$(MINGW_TMP) |
| 77 | |
| 78 | touch install-stamp |
| 79 | |
| 80 | # Build architecture-independent files here. |
| 81 | binary-indep: build install |
| 82 | # No binary-indep target. |
| 83 | |
| 84 | # Build architecture-dependent files here. |
| 85 | binary-arch: build install |
| 86 | dh_testdir |
| 87 | dh_testroot |
| 88 | dh_installdocs |
| 89 | dh_installexamples |
| 90 | dh_installchangelogs NEWS |
| 91 | dh_strip |
| 92 | dh_compress |
| 93 | dh_fixperms |
| 94 | dh_installdeb |
| 95 | dh_shlibdeps |
| 96 | dh_gencontrol |
| 97 | dh_md5sums |
| 98 | dh_builddeb |
| 99 | |
| 100 | binary: binary-indep binary-arch |
| 101 | .PHONY: build clean binary-indep binary-arch binary install install-stamp |