• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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)
11DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
12DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
13
14MY_ABI=6
15
16BUILD_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    = x86_64-w64-mingw32
22MINGW_BIN = /usr/bin
23MINGW_TOP = /usr/$(TARGET)
24MINGW_TMP = $(CURDIR)/debian/mingw64-ncurses$(MY_ABI)
25
26CFLAGS = $(CC_NORMAL)
27
28verbose = # -v
29
30CONFIG_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-opaque-curses \
41	--enable-opaque-form \
42	--enable-opaque-menu \
43	--enable-opaque-panel \
44	--enable-pc-files \
45	--enable-term-driver \
46	--enable-warnings \
47	--enable-widec \
48	--verbose \
49	--with-abi-version=$(MY_ABI) \
50	--with-cxx-shared \
51	--with-develop \
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) \
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
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) \
86		--with-pc-suffix=$(MY_ABI) \
87		--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
114	dh_prep
115	dh_installdirs      $(verbose)
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.
129binary-indep: build install
130# No binary-indep target.
131
132# Build architecture-dependent files here.
133binary-arch: build install
134	dh_testdir
135	dh_testroot          $(verbose)
136	dh_lintian           $(verbose)
137	dh_installdocs       $(verbose)
138	dh_installchangelogs $(verbose) NEWS
139	# dh_strip
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)
147
148binary: binary-indep binary-arch
149.PHONY: build clean binary-indep binary-arch binary install install-stamp
150