(svn r27967) -Update from Eints:
[openttd.git] / os / debian / rules
blobdfd39253ef1585c4c3680b660fa9a8b58da2d0f9
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Makefile to build the openttd debian package.
5 # Use debhelper default for all targets (but some are overridden below).
6 %:
7 dh --parallel $@
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 ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
12 CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
13 endif
15 # This prevents linking uselessly to libicudata and silences a warning
16 # in the build process.
17 DEB_LDFLAGS_MAINT_APPEND="-Wl,-as-needed"
19 # Enable all hardening options (since openttd offers a network-listening
20 # service that handles untrusted data).
21 DEB_BUILD_MAINT_OPTIONS=hardening=+all
23 # Load buildflags (this uses dpkg-buildflags). Note that we don't export
24 # them, but instead pass them to ./configure explicitly.
25 include /usr/share/dpkg/buildflags.mk
27 # Pass custom options to configure. Since it's not autoconf but a custom
28 # script, some of the option names are slightly different. We also need
29 # to be explicit about the dependencies, in case we're not running in a
30 # clean build root.
31 override_dh_auto_configure:
32 ./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)"
34 # Do some extra installation
35 override_dh_auto_install:
36 $(MAKE) install DO_NOT_INSTALL_CHANGELOG=1 DO_NOT_INSTALL_LICENSE=1
38 # Don't do testing. Because the OpenTTD Makefile always does dependency
39 # generation (even on invalid targets), dh_auto_test thinks there is a
40 # "test" target, while there isn't.
41 override_dh_auto_test:
43 # Call mrproper. Again, dh_auto_clean thinks there is a distclean
44 # target, while there isn't.
45 override_dh_auto_clean:
46 [ ! -f Makefile ] || $(MAKE) mrproper
48 # We want to strip the debug informatiton into the -dbg package.
49 override_dh_strip:
50 dh_strip --dbg-package=openttd-dbg