2004-09-18 16:29:12 +00:00
|
|
|
#!/usr/bin/make -f
|
|
|
|
# -*- makefile -*-
|
2010-02-18 18:20:15 +00:00
|
|
|
# Makefile to build the openttd debian package.
|
|
|
|
|
|
|
|
# Use debhelper default for all targets (but some are overridden below).
|
|
|
|
%:
|
2013-11-13 19:57:29 +00:00
|
|
|
dh --parallel $@
|
2010-02-18 18:20:15 +00:00
|
|
|
|
|
|
|
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)
|
|
|
|
endif
|
|
|
|
|
2013-11-13 19:57:29 +00:00
|
|
|
# This prevents linking uselessly to libicudata and silences a warning
|
|
|
|
# in the build process.
|
|
|
|
DEB_LDFLAGS_MAINT_APPEND="-Wl,-as-needed"
|
|
|
|
|
|
|
|
# Enable all hardening options (since openttd offers a network-listening
|
|
|
|
# service that handles untrusted data).
|
|
|
|
DEB_BUILD_MAINT_OPTIONS=hardening=+all
|
|
|
|
|
|
|
|
# Load buildflags (this uses dpkg-buildflags). Note that we don't export
|
|
|
|
# them, but instead pass them to ./configure explicitly.
|
|
|
|
include /usr/share/dpkg/buildflags.mk
|
|
|
|
|
2010-02-18 18:20:15 +00:00
|
|
|
# Pass custom options to configure. Since it's not autoconf but a custom
|
|
|
|
# script, some of the option names are slightly different. We also need
|
|
|
|
# to be explicit about the dependencies, in case we're not running in a
|
|
|
|
# clean build root.
|
|
|
|
override_dh_auto_configure:
|
2014-01-07 19:31:46 +00:00
|
|
|
./configure $(CROSS) --prefix-dir=/usr --install-dir=debian/openttd --without-allegro --with-zlib --with-sdl --with-png --with-freetype --with-fontconfig --with-icu --with-liblzo2 --with-lzma --without-xdg-basedir --without-iconv --disable-strip CFLAGS="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS="$(CXXFLAGS) $(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" CFLAGS_BUILD="$(CFLAGS) $(CPPFLAGS)" CXXFLAGS_BUILD="$(CXXFLAGS) $(CPPFLAGS)" LDFLAGS_BUILD="$(LDFLAGS)"
|
2010-02-18 18:20:15 +00:00
|
|
|
|
|
|
|
# Do some extra installation
|
|
|
|
override_dh_auto_install:
|
2010-10-27 21:56:10 +00:00
|
|
|
$(MAKE) install DO_NOT_INSTALL_CHANGELOG=1 DO_NOT_INSTALL_LICENSE=1
|
2004-09-18 16:29:12 +00:00
|
|
|
|
2010-02-18 18:20:15 +00:00
|
|
|
# Don't do testing. Because the OpenTTD Makefile always does dependency
|
|
|
|
# generation (even on invalid targets), dh_auto_test thinks there is a
|
|
|
|
# "test" target, while there isn't.
|
|
|
|
override_dh_auto_test:
|
2004-09-18 16:29:12 +00:00
|
|
|
|
2010-02-18 18:20:15 +00:00
|
|
|
# Call mrproper. Again, dh_auto_clean thinks there is a distclean
|
|
|
|
# target, while there isn't.
|
|
|
|
override_dh_auto_clean:
|
2008-11-30 18:45:44 +00:00
|
|
|
[ ! -f Makefile ] || $(MAKE) mrproper
|
2010-07-11 17:51:02 +00:00
|
|
|
|
|
|
|
# We want to strip the debug informatiton into the -dbg package.
|
|
|
|
override_dh_strip:
|
|
|
|
dh_strip --dbg-package=openttd-dbg
|