#!/usr/bin/make -f BUILDDIR = debian/wmpuzzle DEBDIR = $(BUILDDIR)/DEBIAN DOCDIR = $(BUILDDIR)/usr/share/doc/wmpuzzle testdir = test -f src/wmpuzzle.c && test -f debian/rules testroot = test x`whoami` = xroot ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) CONFFLAGS += --build $(DEB_HOST_GNU_TYPE) else CONFFLAGS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif CPPFLAGS = -Wall $(shell dpkg-buildflags --get CPPFLAGS) export CPPFLAGS CFLAGS = -Wall -g $(shell dpkg-buildflags --get CFLAGS) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif export CFLAGS LDFLAGS = -Wall $(shell dpkg-buildflags --get LDFLAGS) export LDFLAGS clean: $(testdir) rm -f build debian/files debian/substvars [ ! -f src/Makefile ] || $(MAKE) -C src distclean rm -rf debian/wmpuzzle build: build-arch build-indep: build-arch: $(testdir) cd src && ./configure $(CONFFLAGS) --prefix=/usr --bindir=/usr/games --mandir=/usr/share/man $(MAKE) -C src touch build binary: binary-arch binary-indep: binary-arch: build $(testdir) $(testroot) rm -rf debian/wmpuzle $(MAKE) -C src install DESTDIR=$(CURDIR)/debian/wmpuzzle ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) strip -R .comment -R .note $(BUILDDIR)/usr/games/wmpuzzle endif gzip -9n $(BUILDDIR)/usr/share/man/man6/wmpuzzle.6 install -D -p -o root -g root -m 0644 debian/menu $(BUILDDIR)/usr/share/menu/wmpuzzle install -D -p -o root -g root -m 0644 CHANGES $(DOCDIR)/changelog install -D -p -o root -g root -m 0644 CHANGES $(DOCDIR)/changelog install -D -p -o root -g root -m 0644 debian/changelog $(DOCDIR)/changelog.Debian install -p -o root -g root -m 0644 README debian/copyright $(DOCDIR) install -d -p -o root -g root -m 0755 $(DOCDIR)/puzzles install -p -o root -g root -m 0644 src/*.xpm $(DOCDIR)/puzzles gzip -9n $(DOCDIR)/changelog* install -d -p -o root -g root -m 0755 $(DEBDIR) install -p -o root -g root -m 0644 debian/control $(DEBDIR) install -p -o root -g root -m 0755 debian/postinst debian/postrm $(DEBDIR) cd $(BUILDDIR) && find usr -type f -print0 | xargs -0 md5sum > DEBIAN/md5sums chmod 0644 $(DEBDIR)/md5sums dpkg-shlibdeps $(BUILDDIR)/usr/games/wmpuzzle dpkg-gencontrol -isp -pwmpuzzle -P$(BUILDDIR) dpkg --build $(BUILDDIR) .. .PHONY: clean binary binary-indep binary-arch