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
|
#!/usr/bin/make -f
# -*- makefile -*-
#
# Based on dh-make template containing work of Joey Hess, Craig Small
# and Bill Allombert.
#
# Include dpatch
include /usr/share/dpatch/dpatch.make
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This has to be exported to make some magic below work.
export DH_OPTIONS
# These are used for cross-compiling and for saving the configure
# script
# from having to guess our platform (since we know it already)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
# ghc -split-objs only works on i386 and amd64
# but seems to break the profiling build
ifneq (,$(findstring $(DEB_HOST_ARCH),"i386 amd64"))
# CONFIGURE_FLAGS += enable-split-objs
endif
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CONFIGURE_FLAGS += disable-optimization
else
ifneq (,$(findstring $(DEB_HOST_ARCH),"arm"))
CONFIGURE_FLAGS += disable-optimization
endif
endif
setup: patch-stamp
dh_testdir
# chmod a+x configure
# ./configure --prefix=/usr
ghc --make Setup -o setup -package Cabal
configure: configure-arch configure-indep
configure-arch: configure-arch-stamo
configure-arch-stamp: setup
dh_haskell_configure -s $(CONFIGURE_FLAGS)
touch $@
configure-indep: configure-indep-stamp
configure-indep-stamp: setup
dh_haskell_configure -i
touch $@
build: build-arch
build-arch: build-arch-stamp
build-arch-stamp: configure-arch-stamp
dh_haskell_build -s
touch $@
build-indep: build-indep-stamp
build-indep-stamp: configure-indep-stamp
dh_haskell_build -i
touch $@
clean: clean-patched unpatch
clean-patched:
dh_testdir
dh_testroot
rm -f configure-stamp build-stamp
if [ -x setup ] && [ -e .setup-config ]; then ./setup clean ; fi
rm -rf dist html
# rm -f Makefile uulib.cabal
dh_clean setup Setup.hi Setup.o .*config* config.log config.status
install: install-arch install-indep
install-arch: build-arch-stamp
dh_testdir
dh_testroot
dh_clean -k -s -Xdebian/tmp
dh_installdirs -s
dh_haskell_install -s
dh_haskell_prep
dh_install -s
install-indep: build-indep-stamp
dh_testdir
dh_testroot
dh_clean -k -i -Xdebian/tmp
dh_installdirs -i
dh_haskell_install -i
dh_install -i
# Must not depend on anything. This is to be called by
# binary-arch/binary-indep
# in another 'make' thread.
binary-common:
dh_testdir
dh_testroot
dh_installchangelogs
dh_installdocs
dh_compress -X.haddock
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_haskell_depends
dh_gencontrol
dh_md5sums
dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: install-indep
$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
# Build architecture dependant packages using the common target.
binary-arch: install-arch
$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
binary: binary-arch binary-indep
.PHONY: binary binary-arch binary-indep build build-arch build-indep clean clean-patched configure configure-arch configure-indep install install-arch install-indep
|