#! /usr/bin/make -f ## debian/rules for ratpoison ## Copyright (C) 2001 Gergely Nagy <8@free.bsd.hu> export DH_COMPAT = 2 DEBHELPER_OPTIONS = -p$@ -Pdebian/$(DEB_HOST_ARCH)/$@ PWD := $(CURDIR) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) CFLAGS = -O2 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif # bootstrap - for building from CVS snapshots bootstrap: build-deb/$(DEB_HOST_ARCH)/bootstrap-stamp build-deb/$(DEB_HOST_ARCH)/bootstrap-stamp: test -f configure || ./autogen.sh install -d build-deb/$(DEB_HOST_ARCH) touch $@ # config - run configure config: bootstrap build-deb/$(DEB_HOST_ARCH)/config-stamp build-deb/$(DEB_HOST_ARCH)/config-stamp: dh_testdir cd build-deb/$(DEB_HOST_ARCH) && \ CFLAGS="$(CFLAGS)" ../../configure \ --prefix=/usr \ --infodir=/usr/share/info \ --mandir=/usr/share/man \ --with-xterm=x-terminal-emulator \ --disable-debug \ --build=$(DEB_BUILD_GNU_TYPE) \ --host=$(DEB_HOST_GNU_TYPE) touch $@ # build - build the package build: config build-deb/$(DEB_HOST_ARCH)/build-stamp build-deb/$(DEB_HOST_ARCH)/build-stamp: dh_testdir $(MAKE) -C build-deb/$(DEB_HOST_ARCH) all touch $@ # clean - remove build directories clean: dh_testdir dh_testroot -$(MAKE) -C build-deb/$(DEB_HOST_ARCH) distclean rm -Rf build-deb/$(DEB_HOST_ARCH) @for m in $(shell dh_listpackages); do \ echo "dh_clean -p$$m -Pdebian/$(DEB_HOST_ARCH)/$$m" ;\ dh_clean -p$$m -Pdebian/$(DEB_HOST_ARCH)/$$m ;\ done rm -Rf debian/$(DEB_HOST_ARCH) # install - install the package to debian//ratpoison install: build dh_testdir dh_testroot @for m in $(shell dh_listpackages); do \ echo "dh_clean -k -Pdebian/$(DEB_HOST_ARCH)/$$m -p$$m" ;\ dh_clean -k -Pdebian/$(DEB_HOST_ARCH)/$$m -p$$m ;\ echo "dh_installdirs -Pdebian/$(DEB_HOST_ARCH)/$$m -p$$m" ;\ dh_installdirs -Pdebian/$(DEB_HOST_ARCH)/$$m -p$$m ;\ done $(MAKE) -C build-deb/$(DEB_HOST_ARCH) \ install DESTDIR=$(PWD)/debian/$(DEB_HOST_ARCH)/ratpoison rm -f $(PWD)/debian/$(DEB_HOST_ARCH)/ratpoison/usr/share/doc/COPYING # these build the various packages ratpoison: install dh_testdir dh_testroot dh_installdocs $(DEBHELPER_OPTIONS) dh_installexamples $(DEBHELPER_OPTIONS) dh_installmenu $(DEBHELPER_OPTIONS) # dh_installlogrotate $(DEBHELPER_OPTIONS) # dh_installemacsen $(DEBHELPER_OPTIONS) # dh_installpam $(DEBHELPER_OPTIONS) # dh_installinit $(DEBHELPER_OPTIONS) # dh_installcron $(DEBHELPER_OPTIONS) dh_installmanpages $(DEBHELPER_OPTIONS) dh_installinfo $(DEBHELPER_OPTIONS) # dh_undocumented $(DEBHELPER_OPTIONS) dh_installchangelogs src/ChangeLog $(DEBHELPER_OPTIONS) dh_installwm $(DEBHELPER_OPTIONS) dh_link $(DEBHELPER_OPTIONS) dh_strip $(DEBHELPER_OPTIONS) dh_compress $(DEBHELPER_OPTIONS) dh_fixperms $(DEBHELPER_OPTIONS) # dh_makeshlibs $(DEBHELPER_OPTIONS) dh_installdeb $(DEBHELPER_OPTIONS) # dh_perl $(DEBHELPER_OPTIONS) dh_shlibdeps $(DEBHELPER_OPTIONS) dh_gencontrol $(DEBHELPER_OPTIONS) dh_md5sums $(DEBHELPER_OPTIONS) dh_builddeb $(DEBHELPER_OPTIONS) # binary-arch, binary-indep, binary - targets required by DP binary-arch: ratpoison binary-indep: binary: binary-indep binary-arch # rebuild - rebuild from (almost) pristine sources rebuild: clean binary .PHONY: build clean binary-indep binary-arch binary install rebuild \ bootstrap config ratpoison