1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
#!/usr/bin/make -f
#export DH_VERBOSE=1
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS = --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS = --build $(DEB_BUILD_GNU_TYPE)
endif
CFLAGS = -Wall -g
LDFLAGS = -Wl,-z,defs
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
MAKEFLAGS += -j$(NUMJOBS)
endif
# Configure the package
# -------------------------------------
configure: config.status
config.status:
dh_testdir
[ -d backup ] || ( mkdir backup && cp -f po/*.po backup )
# sed -i -e 's_automake[^/" ]*_automake-1.10_g' autogen.sh
# sed -i -e 's_aclocal[^/" ]*_aclocal-1.10_g' autogen.sh
# ./autogen.sh
# Remove GLee embedded code copy so we never use it
rm -f lib/ivis_opengl/GLee.c lib/ivis_opengl/GLee.h
./configure \
CFLAGS="$(CFLAGS)" \
LDFLAGS="$(LDFLAGS)" \
$(CROSS) \
--prefix=/usr \
--bindir=\$${prefix}/games \
--datadir=\$${prefix}/share/games \
--mandir=\$${prefix}/share/man \
--with-icondir=\$${prefix}/share/icons/hicolor/128x128/apps \
--with-applicationdir=\$${prefix}/share/applications \
--with-distributor=Debian \
--disable-debug
# -------------------------------------
# Compile the source
# -------------------------------------
build: build-stamp
build-stamp: config.status
dh_testdir
$(MAKE)
touch $@
# -------------------------------------
# Clean source directory
# -------------------------------------
clean: clean-really
clean-really:
dh_testdir
dh_testroot
dh_clean
rm -f build-stamp
[ ! -f Makefile ] || $(MAKE) distclean
-mv -f backup/*.po po/
# find -iname Makefile.in -print0 | xargs -0 rm -f
# rm -rf depcomp aclocal.m4 configure config.guess \
# backup install-sh config.sub missing config.h.in po/warzone2100.pot
# sed -i -e 's_automake[^/" ]*_automake_g' autogen.sh
# sed -i -e 's_aclocal[^/" ]*_aclocal_g' autogen.sh
# -------------------------------------
# Install all files
# -------------------------------------
install: build
dh_testdir
dh_testroot
dh_prep
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
rm -rf debian/tmp/usr/share/doc/warzone2100
# -------------------------------------
# Build architecture-independent files
# -------------------------------------
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installdirs -i
dh_install -i --sourcedir=debian/tmp --list-missing
dh_installchangelogs -i ChangeLog
dh_installdocs -i
dh_compress -i
dh_fixperms -i
dh_installdeb -i
dh_gencontrol -i
dh_md5sums -i
dh_builddeb -i
# -------------------------------------
# Build architecture-dependent files
# -------------------------------------
binary-arch: build install
dh_testdir -a
dh_testroot -a
dh_installdirs -a
dh_install -a --sourcedir=debian/tmp --list-missing
dh_installchangelogs -a ChangeLog
dh_installdocs -a
dh_installmenu -a
dh_icons -a
dh_installman -a debian/warzone2100.6
dh_strip -a --dbg-package=warzone2100-dbg
dh_compress -a
dh_fixperms -a
dh_installdeb -a
dh_shlibdeps -a
dh_gencontrol -a
dh_md5sums -a
dh_builddeb -a
# -------------------------------------
binary: binary-indep binary-arch
.PHONY: configure build clean clean-really binary-indep binary-arch binary install
|