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