blob: 152cd3c77f9552002da764db470a641de61c9b56 [file] [log] [blame]
Steve Kondikae271bc2015-11-15 02:50:53 +01001#!/usr/bin/make -f
micky3879b9f5e72025-07-08 18:04:53 -04002# Made with the aid of dh_make, by Craig Small
Steve Kondikae271bc2015-11-15 02:50:53 +01003# 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
14CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion
15CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic
16
micky3879b9f5e72025-07-08 18:04:53 -040017NCURSES_PKG = ncurses-examples
18
Steve Kondikae271bc2015-11-15 02:50:53 +010019TARGET = i686-w64-mingw32
20MINGW_BIN = /usr/bin
21MINGW_TOP = /usr/$(TARGET)
22MINGW_TMP = $(CURDIR)/debian/mingw32-ncurses-examples
23
24CFLAGS = $(CC_NORMAL)
25
26ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
27 CFLAGS += -O0
28else
29 CFLAGS += -O2
30endif
31ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
32 INSTALL_PROGRAM += -s
33endif
34
35
36configure: configure-stamp
37configure-stamp:
38 dh_testdir
39
40 CFLAGS="$(CFLAGS)" ./configure \
41 --host=$(TARGET) \
42 --target=$(TARGET) \
43 --prefix=$(MINGW_TOP) \
micky3879b9f5e72025-07-08 18:04:53 -040044 --bindir=\$${prefix}/bin/$(NCURSES_PKG) \
45 --datadir=\$${prefix}/share/$(NCURSES_PKG) \
Steve Kondikae271bc2015-11-15 02:50:53 +010046 --with-screen=ncursesw6 \
47 --with-pkg-config-libdir=/usr/$(TARGET)/lib/pkgconfig
48
49 touch configure-stamp
50
51build: build-stamp
52build-stamp: configure-stamp
53 dh_testdir
54
55 $(MAKE)
56
57 touch build-stamp
58
59clean:
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
69install: install-stamp
70install-stamp: build-stamp
71 dh_testdir
72 dh_testroot
micky3879b9f5e72025-07-08 18:04:53 -040073 dh_prep
Steve Kondikae271bc2015-11-15 02:50:53 +010074 dh_installdirs
75
76 $(MAKE) install DESTDIR=$(MINGW_TMP)
77
78 touch install-stamp
79
80# Build architecture-independent files here.
81binary-indep: build install
82# No binary-indep target.
83
84# Build architecture-dependent files here.
85binary-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
100binary: binary-indep binary-arch
101.PHONY: build clean binary-indep binary-arch binary install install-stamp