blob: 8c266a93af08260ccfb0adbabf26ef1a0278cbe3 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001#!/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)
11DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
micky3879b9f5e72025-07-08 18:04:53 -040014MY_ABI=6
15
Steve Kondikae271bc2015-11-15 02:50:53 +010016BUILD_CC = gcc
17
18CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
19CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
20
21TARGET = i686-w64-mingw32
22MINGW_BIN = /usr/bin
23MINGW_TOP = /usr/$(TARGET)
micky3879b9f5e72025-07-08 18:04:53 -040024MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses$(MY_ABI)
Steve Kondikae271bc2015-11-15 02:50:53 +010025
26CFLAGS = $(CC_NORMAL)
27
micky3879b9f5e72025-07-08 18:04:53 -040028verbose = # -v
29
Steve Kondikae271bc2015-11-15 02:50:53 +010030CONFIG_OPTIONS = \
Steve Kondikae271bc2015-11-15 02:50:53 +010031 --disable-db-install \
micky3879b9f5e72025-07-08 18:04:53 -040032 --disable-echo \
Steve Kondikae271bc2015-11-15 02:50:53 +010033 --disable-getcap \
34 --disable-hard-tabs \
35 --disable-leaks \
36 --disable-macros \
37 --disable-overwrite \
38 --disable-termcap \
39 --enable-interop \
micky3879b9f5e72025-07-08 18:04:53 -040040 --enable-opaque-curses \
41 --enable-opaque-form \
42 --enable-opaque-menu \
43 --enable-opaque-panel \
Steve Kondikae271bc2015-11-15 02:50:53 +010044 --enable-pc-files \
45 --enable-term-driver \
46 --enable-warnings \
47 --enable-widec \
48 --verbose \
micky3879b9f5e72025-07-08 18:04:53 -040049 --with-abi-version=$(MY_ABI) \
Steve Kondikae271bc2015-11-15 02:50:53 +010050 --with-cxx-shared \
51 --with-develop \
micky3879b9f5e72025-07-08 18:04:53 -040052 --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 Kondikae271bc2015-11-15 02:50:53 +010055 --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
64export CFLAGS BUILD_CC
65
66ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
67 CFLAGS += -O0
68else
69 CFLAGS += -O2
70endif
71ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
72 INSTALL_PROGRAM += -s
73endif
74
75configure: configure-stamp
76configure-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) \
micky3879b9f5e72025-07-08 18:04:53 -040086 --with-pc-suffix=$(MY_ABI) \
Steve Kondikae271bc2015-11-15 02:50:53 +010087 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig \
88 $(CONFIG_OPTIONS)
89
90 touch configure-stamp
91
92build: build-stamp
93build-stamp: configure-stamp
94 dh_testdir
95
96 $(MAKE)
97
98 touch build-stamp
99
100clean:
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
110install: install-stamp
111install-stamp: build-stamp
112 dh_testdir
113 dh_testroot
micky3879b9f5e72025-07-08 18:04:53 -0400114 dh_prep
115 dh_installdirs $(verbose)
Steve Kondikae271bc2015-11-15 02:50:53 +0100116
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.
129binary-indep: build install
130# No binary-indep target.
131
132# Build architecture-dependent files here.
133binary-arch: build install
134 dh_testdir
micky3879b9f5e72025-07-08 18:04:53 -0400135 dh_testroot $(verbose)
136 dh_lintian $(verbose)
137 dh_installdocs $(verbose)
138 dh_installchangelogs $(verbose) NEWS
Steve Kondikae271bc2015-11-15 02:50:53 +0100139 # dh_strip
micky3879b9f5e72025-07-08 18:04:53 -0400140 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 Kondikae271bc2015-11-15 02:50:53 +0100147
148binary: binary-indep binary-arch
149.PHONY: build clean binary-indep binary-arch binary install install-stamp