| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
|
| 7 |
# This has to be exported to make some magic below work. |
| 8 |
export DH_OPTIONS |
| 9 |
|
| 10 |
FPCFLAGS := -g |
| 11 |
|
| 12 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) |
| 13 |
else |
| 14 |
FPCFLAGS += -O2 |
| 15 |
endif |
| 16 |
|
| 17 |
-include /usr/share/dpkg/buildflags.mk |
| 18 |
export FPCFLAGS |
| 19 |
|
| 20 |
GEARHEADDATAVERSION=$(shell dpkg -s gearhead-data | perl -ne 'if (/^Version:\s+(\S+)/) {print $$1; exit 0;}') |
| 21 |
|
| 22 |
build: build-arch build-indep |
| 23 |
|
| 24 |
build-arch: build-arch-stamp |
| 25 |
build-arch-stamp: build-arch-console-stamp build-arch-sdl-stamp |
| 26 |
touch build-arch-stamp |
| 27 |
|
| 28 |
build-arch-console-stamp: debian/build/console |
| 29 |
dh_testdir |
| 30 |
cd debian/build/console && fpc $(FPCFLAGS) -XD -dASCII gearhead2 |
| 31 |
touch build-arch-stamp |
| 32 |
|
| 33 |
build-arch-sdl-stamp :: debian/build/sdl |
| 34 |
dh_testdir |
| 35 |
sed -i s/gearhead2.conf/gearhead2-sdl.conf/ debian/build/sdl/gears.pp |
| 36 |
cd debian/build/sdl && fpc $(FPCFLAGS) -dSLDMODE gearhead2 |
| 37 |
touch build-arch-sdl-stamp |
| 38 |
|
| 39 |
debian/build/console debian/build/sdl: |
| 40 |
dh_testdir |
| 41 |
mkdir -p $@ |
| 42 |
cp *.pas *.pp $@ |
| 43 |
|
| 44 |
build-indep: build-indep-stamp |
| 45 |
build-indep-stamp: |
| 46 |
dh_testdir |
| 47 |
|
| 48 |
touch build-indep-stamp |
| 49 |
|
| 50 |
clean: |
| 51 |
dh_testdir |
| 52 |
dh_testroot |
| 53 |
rm -f build-arch-stamp build-arch-console-stamp build-arch-sdl-stamp build-indep-stamp |
| 54 |
|
| 55 |
rm -rf debian/build |
| 56 |
|
| 57 |
dh_clean |
| 58 |
|
| 59 |
install: install-indep install-arch |
| 60 |
install-indep: build-indep-stamp |
| 61 |
dh_testdir |
| 62 |
dh_testroot |
| 63 |
dh_prep |
| 64 |
dh_installdirs -i |
| 65 |
|
| 66 |
dh_install -i -X.obj |
| 67 |
|
| 68 |
install-arch: build-arch-stamp |
| 69 |
dh_testdir |
| 70 |
dh_testroot |
| 71 |
dh_prep |
| 72 |
dh_installdirs -a |
| 73 |
|
| 74 |
dh_install -a -X man_ |
| 75 |
install -D -m 644 readme.txt debian/gearhead2/usr/share/doc/gearhead2/README |
| 76 |
install -D -m 644 readme.txt debian/gearhead2-sdl/usr/share/doc/gearhead2-sdl/README |
| 77 |
install -D debian/build/sdl/gearhead2 debian/gearhead2-sdl/usr/games/gearhead2-sdl |
| 78 |
|
| 79 |
binary-indep: install-indep |
| 80 |
dh_testdir |
| 81 |
dh_testroot |
| 82 |
dh_installchangelogs -i history.txt |
| 83 |
dh_installdocs -i -X history.txt |
| 84 |
dh_installexamples -i |
| 85 |
dh_installmenu -i |
| 86 |
dh_installman -i |
| 87 |
dh_link -i |
| 88 |
cd debian/gearhead2-data/usr/share/games/gearhead2/image; \ |
| 89 |
for f in *.png; do if [ -e /usr/share/games/gearhead/Image/"$$f" ] && idiff "$$f" /usr/share/games/gearhead/Image/"$$f" >/dev/null 2>/dev/null; then \ |
| 90 |
rm "$$f"; ln -s ../../gearhead/Image/"$$f" . ; \ |
| 91 |
fi; done |
| 92 |
cd debian/gearhead2-data/usr/share/games/gearhead2/gamedata; \ |
| 93 |
for f in *.txt; do if [ -e /usr/share/games/gearhead/GameData/"$$f" ] && cmp -s "$$f" /usr/share/games/gearhead/GameData/"$$f" 2>/dev/null; then \ |
| 94 |
rm "$$f"; ln -s ../../gearhead/GameData/"$$f" . ; \ |
| 95 |
fi; done |
| 96 |
dh_compress -i |
| 97 |
dh_fixperms -i |
| 98 |
dh_installdeb -i |
| 99 |
dh_gencontrol -i -- -Vgearhead-version=$(GEARHEADDATAVERSION) |
| 100 |
dh_md5sums -i |
| 101 |
dh_builddeb -i |
| 102 |
|
| 103 |
binary-arch: install-arch |
| 104 |
dh_testdir |
| 105 |
dh_testroot |
| 106 |
dh_installchangelogs -a history.txt |
| 107 |
dh_installdocs -a -X history.txt |
| 108 |
dh_installexamples -a |
| 109 |
dh_installmenu -a |
| 110 |
dh_installman -a |
| 111 |
dh_link -a |
| 112 |
dh_strip -a |
| 113 |
dh_compress -a |
| 114 |
dh_fixperms -a |
| 115 |
dh_makeshlibs -a |
| 116 |
dh_installdeb -a |
| 117 |
dh_shlibdeps -a |
| 118 |
dh_gencontrol -a |
| 119 |
dh_md5sums -a |
| 120 |
dh_builddeb -a |
| 121 |
|
| 122 |
binary: binary-arch binary-indep |
| 123 |
.PHONY: build build-arch build-indep clean binary-indep binary-arch binary install install-indep install-arch configure |