| 1 |
#!/usr/bin/make -f |
| 2 |
# $Id: rules,v 1.7 2024/06/20 00:19:38 tom Exp $ |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
# These are used for cross-compiling and for saving the configure script |
| 8 |
# from having to guess our platform (since we know it already) |
| 9 |
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 10 |
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 11 |
|
| 12 |
BUILD_CC = gcc |
| 13 |
|
| 14 |
CC_NORMAL = -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wconversion |
| 15 |
CC_STRICT = $(CC_NORMAL) -W -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wwrite-strings -ansi -pedantic |
| 16 |
|
| 17 |
TARGET = amd64-mingw32msvc |
| 18 |
MINGW_TOP = /usr/$(TARGET) |
| 19 |
MINGW_USE = $(CURDIR)/debian/mingw64-libcdk5 |
| 20 |
MINGW_DEV = $(CURDIR)/debian/mingw64-libcdk5-dev |
| 21 |
|
| 22 |
CFLAGS = $(CC_NORMAL) |
| 23 |
|
| 24 |
CONFIG_OPTIONS = \ |
| 25 |
--disable-echo \ |
| 26 |
--verbose \ |
| 27 |
--with-shared \ |
| 28 |
--enable-pc-files \ |
| 29 |
--enable-warnings \ |
| 30 |
--enable-stdnoreturn \ |
| 31 |
--enable-const \ |
| 32 |
--with-screen=ncursesw6td \ |
| 33 |
--with-pkg-config-libdir=$(MINGW_TOP)/lib/pkgconfig |
| 34 |
|
| 35 |
verbose = # -v |
| 36 |
|
| 37 |
export CFLAGS BUILD_CC |
| 38 |
|
| 39 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 40 |
CFLAGS += -O0 |
| 41 |
else |
| 42 |
CFLAGS += -O2 |
| 43 |
endif |
| 44 |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 45 |
INSTALL_PROGRAM += -s |
| 46 |
endif |
| 47 |
|
| 48 |
configure: configure-stamp |
| 49 |
configure-stamp: |
| 50 |
dh_testdir |
| 51 |
|
| 52 |
CC=$(TARGET)-gcc \ |
| 53 |
CFLAGS="$(CFLAGS)" \ |
| 54 |
./configure \ |
| 55 |
--host=$(TARGET) \ |
| 56 |
--target=$(TARGET) \ |
| 57 |
--prefix=$(MINGW_TOP) \ |
| 58 |
--with-build-cc=$(BUILD_CC) \ |
| 59 |
$(CONFIG_OPTIONS) |
| 60 |
|
| 61 |
touch configure-stamp |
| 62 |
|
| 63 |
build: build-stamp |
| 64 |
build-stamp: configure-stamp |
| 65 |
dh_testdir |
| 66 |
|
| 67 |
$(MAKE) |
| 68 |
|
| 69 |
touch build-stamp |
| 70 |
|
| 71 |
clean: |
| 72 |
dh_testdir |
| 73 |
dh_testroot |
| 74 |
|
| 75 |
[ ! -f makefile ] || $(MAKE) distclean |
| 76 |
|
| 77 |
rm -f configure-stamp build-stamp install-stamp |
| 78 |
|
| 79 |
dh_clean |
| 80 |
|
| 81 |
install: install-stamp |
| 82 |
install-stamp: build-stamp |
| 83 |
dh_testdir |
| 84 |
dh_testroot |
| 85 |
dh_clean -k $(verbose) |
| 86 |
dh_installdirs $(verbose) |
| 87 |
|
| 88 |
$(MAKE) installCDKLibrary DESTDIR=$(MINGW_DEV) |
| 89 |
mkdir $(verbose) -p $(MINGW_USE)$(MINGW_TOP)/lib |
| 90 |
mv $(verbose) $(MINGW_DEV)$(MINGW_TOP)/lib/*.dll $(MINGW_USE)$(MINGW_TOP)/lib/ |
| 91 |
chmod -x $(verbose) $(MINGW_USE)$(MINGW_TOP)/lib/*.dll |
| 92 |
$(MAKE) installImportLibrary DESTDIR=$(MINGW_DEV) |
| 93 |
$(MAKE) installCDKHeaderFiles DESTDIR=$(MINGW_DEV) |
| 94 |
|
| 95 |
touch install-stamp |
| 96 |
|
| 97 |
# Build architecture-independent files here. |
| 98 |
binary-indep: build install |
| 99 |
# No binary-indep target. |
| 100 |
|
| 101 |
# Build architecture-dependent files here. |
| 102 |
binary-arch: build install |
| 103 |
dh_testdir |
| 104 |
dh_testroot |
| 105 |
dh_installdocs $(verbose) |
| 106 |
dh_installchangelogs $(verbose) |
| 107 |
dh_compress $(verbose) |
| 108 |
dh_fixperms $(verbose) |
| 109 |
dh_installdeb $(verbose) |
| 110 |
dh_shlibdeps $(verbose) |
| 111 |
dh_gencontrol $(verbose) |
| 112 |
dh_md5sums $(verbose) |
| 113 |
dh_builddeb $(verbose) |
| 114 |
|
| 115 |
binary: binary-indep binary-arch |
| 116 |
.PHONY: build clean binary-indep binary-arch binary install install-stamp |