| #!/usr/bin/make -f |
| # -*-makefile-*- |
| # based on the sample debian/rules file for GNU hello by Ian Jackson. |
| |
| package:=grub |
| |
| # For cross-compilation. |
| DEB_BUILD_ARCH := $(shell dpkg --print-installation-architecture) |
| DEB_BUILD_GNU_CPU := $(patsubst hurd-%,%,$(DEB_BUILD_ARCH)) |
| ifeq ($(filter-out hurd-%,$(DEB_BUILD_ARCH)),) |
| DEB_BUILD_GNU_SYSTEM := gnu |
| else |
| DEB_BUILD_GNU_SYSTEM := linux |
| endif |
| DEB_BUILD_GNU_TYPE := $(DEB_BUILD_GNU_CPU)-$(DEB_BUILD_GNU_SYSTEM) |
| DEB_HOST_GNU_TYPE := $(DEB_BUILD_GNU_TYPE) |
| |
| INSTALL = install -c |
| INSTALL_DATA = $(INSTALL) -m 644 |
| INSTALL_PROGRAM = $(INSTALL) -m 755 |
| |
| build: |
| $(checkdir) |
| ./configure --prefix=/usr \ |
| $(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ |
| --mandir='$${datadir}/man' --infodir='$${datadir}/info' |
| make |
| echo timestamp > build |
| |
| clean: |
| $(checkdir) |
| -rm -f build |
| -make distclean |
| -rm -f `find . -name "*~"` |
| -rm -rf debian/tmp debian/files* core debian/substvars conftestdir |
| |
| binary-indep: checkroot build |
| $(checkdir) |
| # There are no architecture-independent files to be uploaded |
| # generated by this package. If there were any they would be |
| # made here. |
| |
| binary-arch: checkroot build |
| $(checkdir) |
| -rm -rf debian/tmp |
| ## make dirs |
| install -d debian/tmp debian/tmp/usr/share/doc/grub debian/tmp/DEBIAN |
| ## install files |
| |
| dir=`cd debian/tmp && pwd` && make install DESTDIR=$$dir |
| gzip -f9 debian/tmp/usr/share/info/* debian/tmp/usr/share/man/*/* |
| strip -s debian/tmp/usr/sbin/grub debian/tmp/usr/bin/mbchk |
| |
| $(INSTALL_DATA) TODO BUGS NEWS docs/menu.lst \ |
| debian/tmp/usr/share/doc/grub/ |
| |
| $(INSTALL_DATA) ChangeLog debian/tmp/usr/share/doc/grub/changelog |
| gzip -f9 debian/tmp/usr/share/doc/grub/changelog |
| $(INSTALL_DATA) debian/changelog debian/tmp/usr/share/doc/grub/changelog.Debian |
| gzip -f9 debian/tmp/usr/share/doc/grub/changelog.Debian |
| $(INSTALL_DATA) debian/copyright debian/tmp/usr/share/doc/grub/ |
| $(INSTALL_DATA) debian/README.debian debian/tmp/usr/share/doc/grub/ |
| |
| # Install control files. |
| $(INSTALL_PROGRAM) debian/postinst debian/prerm debian/tmp/DEBIAN |
| dpkg-shlibdeps debian/tmp/usr/sbin/grub |
| dpkg-gencontrol |
| chown -R root.root debian/tmp |
| chmod -R go=rX debian/tmp |
| dpkg --build debian/tmp .. |
| |
| define checkdir |
| test -f debian/rules -a -f stage2/fsys_ext2fs.c |
| endef |
| |
| # Below here is fairly generic really |
| |
| binary: binary-indep binary-arch |
| |
| checkroot: |
| $(checkdir) |
| test root = "`whoami`" |
| |
| .PHONY: binary binary-arch binary-indep clean checkroot |