| 1 |
#!/usr/bin/make -f |
| 2 |
# $Id: rules,v 1.18 2025/06/14 20:41:28 tom Exp $ |
| 3 |
# Made with the aid of dh_make, by Craig Small |
| 4 |
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. |
| 5 |
# Some lines taken from debmake, by Cristoph Lameter. |
| 6 |
|
| 7 |
# Uncomment this to turn on verbose mode. |
| 8 |
#export DH_VERBOSE=1 |
| 9 |
|
| 10 |
SHELL = /bin/bash |
| 11 |
DPKG_EXPORT_BUILDFLAGS = 1 |
| 12 |
export DEB_BUILD_MAINT_OPTIONS := hardening=+all qa=+bug reproducible=+all |
| 13 |
|
| 14 |
include /usr/share/dpkg/buildflags.mk |
| 15 |
|
| 16 |
# These are used for cross-compiling and for saving the configure script |
| 17 |
# from having to guess our platform (since we know it already) |
| 18 |
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) |
| 19 |
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) |
| 20 |
|
| 21 |
TARGET_DIR = $(CURDIR)/debian/adacurses |
| 22 |
SAMPLE_DIR = $(TARGET_DIR)/usr/libexec/AdaCurses |
| 23 |
OUR_LIBDIR = /usr/lib/$(DEB_HOST_GNU_TYPE) |
| 24 |
|
| 25 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 26 |
CFLAGS += -O0 |
| 27 |
else |
| 28 |
CFLAGS += -O2 |
| 29 |
endif |
| 30 |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) |
| 31 |
INSTALL_PROGRAM += -s |
| 32 |
endif |
| 33 |
|
| 34 |
verbose = # -v |
| 35 |
|
| 36 |
configure: configure-stamp |
| 37 |
configure-stamp: |
| 38 |
dh_testdir |
| 39 |
|
| 40 |
./configure \ |
| 41 |
--host=$(DEB_HOST_GNU_TYPE) \ |
| 42 |
--build=$(DEB_BUILD_GNU_TYPE) \ |
| 43 |
--libdir=$(OUR_LIBDIR) \ |
| 44 |
--prefix=/usr \ |
| 45 |
--disable-rpath-link \ |
| 46 |
--with-shared \ |
| 47 |
--with-ada-sharedlib \ |
| 48 |
--with-screen=ncursesw6td \ |
| 49 |
--without-pkg-config |
| 50 |
|
| 51 |
touch configure-stamp |
| 52 |
|
| 53 |
build: build-stamp |
| 54 |
build-stamp: configure-stamp |
| 55 |
dh_testdir |
| 56 |
|
| 57 |
$(MAKE) |
| 58 |
|
| 59 |
touch build-stamp |
| 60 |
|
| 61 |
clean: |
| 62 |
dh_testdir |
| 63 |
dh_testroot |
| 64 |
|
| 65 |
[ ! -f makefile ] || $(MAKE) distclean |
| 66 |
|
| 67 |
rm -f configure-stamp build-stamp install-stamp |
| 68 |
|
| 69 |
dh_clean $(verbose) |
| 70 |
|
| 71 |
install: install-stamp |
| 72 |
install-stamp: build-stamp |
| 73 |
dh_testdir |
| 74 |
dh_testroot |
| 75 |
dh_prep $(verbose) |
| 76 |
dh_installdirs $(verbose) |
| 77 |
|
| 78 |
$(MAKE) install DESTDIR=$(TARGET_DIR) |
| 79 |
|
| 80 |
# FIXME: it would be nice to make these into separate packages |
| 81 |
( cd samples && $(MAKE) install.examples DESTDIR=$(TARGET_DIR) BINDIR=$(SAMPLE_DIR) ) |
| 82 |
( cd doc && $(MAKE) install.html DESTDIR=$(TARGET_DIR) ) |
| 83 |
|
| 84 |
find $(TARGET_DIR) -type f -name '*.so*' -print -exec chrpath -d {} \; |
| 85 |
|
| 86 |
touch install-stamp |
| 87 |
|
| 88 |
# Build architecture-independent files here. |
| 89 |
binary-indep: build install |
| 90 |
# No binary-indep target. |
| 91 |
|
| 92 |
# Build architecture-dependent files here. |
| 93 |
binary-arch: build install |
| 94 |
dh_testdir |
| 95 |
dh_testroot |
| 96 |
dh_lintian $(verbose) |
| 97 |
dh_installdocs $(verbose) |
| 98 |
dh_installexamples $(verbose) |
| 99 |
dh_installchangelogs $(verbose) NEWS |
| 100 |
dh_strip $(verbose) |
| 101 |
dh_compress $(verbose) |
| 102 |
dh_fixperms $(verbose) |
| 103 |
dh_installdeb $(verbose) |
| 104 |
dh_makeshlibs $(verbose) |
| 105 |
dh_shlibdeps $(verbose) -l$(OUR_LIBDIR) |
| 106 |
dh_gencontrol $(verbose) |
| 107 |
dh_md5sums $(verbose) |
| 108 |
dh_builddeb $(verbose) |
| 109 |
|
| 110 |
binary: binary-indep binary-arch |
| 111 |
.PHONY: build clean binary-indep binary-arch binary install install-stamp |