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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
|
#!/usr/bin/make -f
# Author: Paul Corner <paul_c@gna.org>
# Created on: Sat Mar 3 12:00 GMT 2007
# License: GPL Ver. 2
#export DH_VERBOSE=1
DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
ifeq ($(DEB_HOST_ARCH), i386)
# Note: Would like to use --includedir=/usr/include/xenomai, but
# there appears to be a `make install` problem.
CONFIG_OPTS = \
--enable-x86-tsc
endif
ifeq ($(DEB_HOST_ARCH), amd64)
CONFIG_OPTS = \
--enable-smp \
--enable-x86-tsc \
--enable-x86-sep
endif
ifeq ($(DEB_HOST_ARCH), powerpc)
CONFIG_OPTS =
endif
ifeq ($(DEB_HOST_ARCH), armeb)
CONFIG_OPTS = --enable-arm-mach=generic --enable-arm-eabi
endif
ifeq ($(DEB_HOST_ARCH), armel)
CONFIG_OPTS = --enable-arm-mach=generic --enable-arm-eabi
endif
ifeq ($(DEB_HOST_ARCH), arm)
CONFIG_OPTS = --enable-arm-mach=generic
endif
CONFIG_OPTS += --prefix=/usr \
--includedir=/usr/include/xenomai \
--mandir=/usr/share/man \
--with-testdir=/usr/lib/xenomai
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE)
endif
build: build-arch build-indep
build-arch: build-arch-stamp
build-arch-stamp: config.status patch-stamp
dh_testdir
$(MAKE)
touch build-arch-stamp
build-indep: build-indep-stamp
build-indep-stamp: config.status
dh_testdir
touch build-indep-stamp
patch-stamp:
dh_testdir
cp debian/linux-patch-xenomai.kpatches.in debian/linux-patch-xenomai.kpatches
for i in arm i386 powerpc x86_64 x86 ; do \
bash $(CURDIR)/debian/prepare-patch.sh $$i ; \
done
touch patch-stamp
config.status: configure-stamp
configure-stamp:
dh_testdir
./configure $(CONFIG_OPTS)
touch configure-stamp
clean:
dh_testdir
dh_testroot
rm -f *-stamp
dh_clean
if test -f Makefile ; then \
$(MAKE) distclean ; \
fi
rm -fR $(CURDIR)/tmp
rm -f $(CURDIR)/*.patch
rm -f $(CURDIR)/debian/*.kpatches
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp/
dh_install --sourcedir=$(CURDIR)/debian/tmp
# xeno-config should be only in libxenomai-dev
rm -f $(CURDIR)/debian/xenomai-runtime/usr/bin/xeno-config
rm -f $(CURDIR)/debian/xenomai-runtime/usr/share/man/man1/xeno-config.1
for f in $(CURDIR)/ksrc/nucleus/udev/*.rules ; do \
cat $$f >> $(CURDIR)/debian/libxenomai1/etc/udev/xenomai.rules ; \
done
install -m 644 debian/libxenomai1.modprobe $(CURDIR)/debian/libxenomai1/etc/modprobe.d/xenomai.conf
# remove empty directory
rm -rf $(CURDIR)/debian/xenomai-doc/usr/share/doc/xenomai-doc/ps
cp debian/libxenomai1.lintian $(CURDIR)/debian/libxenomai1/usr/share/lintian/overrides/libxenomai1
cp debian/libxenomai-dev.lintian $(CURDIR)/debian/libxenomai-dev/usr/share/lintian/overrides/libxenomai-dev
dh_installkpatches
# Build architecture-independent files here.
binary-indep: build install
dh_testdir -i
dh_testroot -i
dh_installdocs -i -A CREDITS README.INSTALL TROUBLESHOOTING
dh_link -i
dh_installchangelogs -i
dh_strip -i
dh_compress -i -X.pdf
dh_fixperms -i
dh_makeshlibs -i
dh_installdeb -i
dh_shlibdeps -i
dh_gencontrol -i
# Here follows a little hackery to insert the patch list
# into the control file for linux-patch-xenomai
cat $(CURDIR)/debian/linux-patch-xenomai.kpatches | \
sed -e 's/^$$/./;s/^/ /' >> \
$(CURDIR)/debian/linux-patch-xenomai/DEBIAN/control
dh_md5sums -i
dh_builddeb -i
# Build architecture-dependent files here.
binary-arch: build install
dh_testdir -s
dh_testroot -s
dh_installinit -s --name=xenomai
dh_installman -s
dh_installdocs -s -A CREDITS README.INSTALL TROUBLESHOOTING
dh_link -s
dh_installchangelogs -s
dh_strip -s
dh_compress -s
dh_fixperms -s
dh_makeshlibs -s
dh_installdeb -s
dh_shlibdeps -s
dh_gencontrol -s
# Echo config options to control.
echo " ." >> $(CURDIR)/debian/libxenomai1/DEBIAN/control
echo " Compiled with the following options." >> \
$(CURDIR)/debian/libxenomai1/DEBIAN/control
echo "$(CONFIG_OPTS)" | awk '{ for ( i=1 ; i<=NF ; i++ ) print " "$$i }' >> \
$(CURDIR)/debian/libxenomai1/DEBIAN/control
# End of hackery.
dh_md5sums -s
dh_builddeb -s
# We have nothing to do by default.
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
|