Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 1 | #!/usr/bin/make -f |
| 2 | # Made with the aid of dh_make, by Craig Small |
| 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 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 14 | MY_ABI=6 |
| 15 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 16 | BUILD_CC = gcc |
| 17 | |
| 18 | CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion |
| 19 | CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic |
| 20 | |
| 21 | TARGET = i686-w64-mingw32 |
| 22 | MINGW_BIN = /usr/bin |
| 23 | MINGW_TOP = /usr/$(TARGET) |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 24 | MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses$(MY_ABI) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 25 | |
| 26 | CFLAGS = $(CC_NORMAL) |
| 27 | |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 28 | verbose = # -v |
| 29 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 30 | CONFIG_OPTIONS = \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 31 | --disable-db-install \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 32 | --disable-echo \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 33 | --disable-getcap \ |
| 34 | --disable-hard-tabs \ |
| 35 | --disable-leaks \ |
| 36 | --disable-macros \ |
| 37 | --disable-overwrite \ |
| 38 | --disable-termcap \ |
| 39 | --enable-interop \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 40 | --enable-opaque-curses \ |
| 41 | --enable-opaque-form \ |
| 42 | --enable-opaque-menu \ |
| 43 | --enable-opaque-panel \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 44 | --enable-pc-files \ |
| 45 | --enable-term-driver \ |
| 46 | --enable-warnings \ |
| 47 | --enable-widec \ |
| 48 | --verbose \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 49 | --with-abi-version=$(MY_ABI) \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 50 | --with-cxx-shared \ |
| 51 | --with-develop \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 52 | --with-fallbacks=unknown,ms-terminal,xterm-256color \ |
| 53 | --with-tic-path=/usr/bin/tic$(MY_ABI) \ |
| 54 | --with-infocmp-path=/usr/bin/infocmp$(MY_ABI) \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 55 | --with-shared \ |
| 56 | --with-trace \ |
| 57 | --with-xterm-kbs=DEL \ |
| 58 | --without-ada \ |
| 59 | --without-debug \ |
| 60 | --without-manpages \ |
| 61 | --without-progs \ |
| 62 | --without-tests |
| 63 | |
| 64 | export CFLAGS BUILD_CC |
| 65 | |
| 66 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 67 | CFLAGS += -O0 |
| 68 | else |
| 69 | CFLAGS += -O2 |
| 70 | endif |
| 71 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 72 | INSTALL_PROGRAM += -s |
| 73 | endif |
| 74 | |
| 75 | configure: configure-stamp |
| 76 | configure-stamp: |
| 77 | dh_testdir |
| 78 | |
| 79 | CC=$(TARGET)-gcc \ |
| 80 | CFLAGS="$(CFLAGS)" \ |
| 81 | ./configure \ |
| 82 | --host=$(TARGET) \ |
| 83 | --target=$(TARGET) \ |
| 84 | --prefix=$(MINGW_TOP) \ |
| 85 | --with-build-cc=$(BUILD_CC) \ |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 86 | --with-pc-suffix=$(MY_ABI) \ |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 87 | --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig \ |
| 88 | $(CONFIG_OPTIONS) |
| 89 | |
| 90 | touch configure-stamp |
| 91 | |
| 92 | build: build-stamp |
| 93 | build-stamp: configure-stamp |
| 94 | dh_testdir |
| 95 | |
| 96 | $(MAKE) |
| 97 | |
| 98 | touch build-stamp |
| 99 | |
| 100 | clean: |
| 101 | dh_testdir |
| 102 | dh_testroot |
| 103 | |
| 104 | [ ! -f makefile ] || $(MAKE) distclean |
| 105 | |
| 106 | rm -f configure-stamp build-stamp install-stamp |
| 107 | |
| 108 | dh_clean |
| 109 | |
| 110 | install: install-stamp |
| 111 | install-stamp: build-stamp |
| 112 | dh_testdir |
| 113 | dh_testroot |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 114 | dh_prep |
| 115 | dh_installdirs $(verbose) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 116 | |
| 117 | $(MAKE) install.libs DESTDIR=$(MINGW_TMP) |
| 118 | |
| 119 | mkdir -p $(MINGW_TMP)$(MINGW_BIN) |
| 120 | for name in $(MINGW_TMP)$(MINGW_TOP)/bin/*-config; \ |
| 121 | do \ |
| 122 | base=`basename $$name`; \ |
| 123 | ln -v $$name $(MINGW_TMP)$(MINGW_BIN)/$(TARGET)-$$base; \ |
| 124 | done |
| 125 | |
| 126 | touch install-stamp |
| 127 | |
| 128 | # Build architecture-independent files here. |
| 129 | binary-indep: build install |
| 130 | # No binary-indep target. |
| 131 | |
| 132 | # Build architecture-dependent files here. |
| 133 | binary-arch: build install |
| 134 | dh_testdir |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 135 | dh_testroot $(verbose) |
| 136 | dh_lintian $(verbose) |
| 137 | dh_installdocs $(verbose) |
| 138 | dh_installchangelogs $(verbose) NEWS |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 139 | # dh_strip |
micky387 | 9b9f5e7 | 2025-07-08 18:04:53 -0400 | [diff] [blame] | 140 | dh_compress $(verbose) |
| 141 | dh_fixperms $(verbose) |
| 142 | dh_installdeb $(verbose) |
| 143 | dh_shlibdeps $(verbose) |
| 144 | dh_gencontrol $(verbose) |
| 145 | dh_md5sums $(verbose) |
| 146 | dh_builddeb $(verbose) |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 147 | |
| 148 | binary: binary-indep binary-arch |
| 149 | .PHONY: build clean binary-indep binary-arch binary install install-stamp |