#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. export DH_COMPAT=3 # 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_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ' | cut -f 1 -d '-') VERSION_NEXT := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ' | cut -f 1 -d '-' |awk -F . '{ $$3=$$3+1; print $$1"."$$2"."$$3 }') VERSION_EXACT := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ') ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure-stamp: configure dh_testdir ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \ --enable-real-life-brokenness # --enable-debugging-features # Work around libtool problem with forcing rpath usage sed < libtool > libtool-2 \ 's/^hardcode_libdir_flag_spec.*$$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/' mv -f libtool-2 libtool chmod 755 libtool touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) touch build-stamp clean: dh_testdir dh_testroot -$(MAKE) clean rm -f config.log find $(CURDIR) -name Makefile |xargs rm -f find $(CURDIR) -type d -name .deps |xargs rm -rf rm -f config.status libtool src/include/config.h src/include/stamp-h1 rm -f build-stamp binary-common configure-stamp dh_clean install: build-stamp dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr -mkdir -p $(CURDIR)/debian/tmp/usr/lib/sablevm/bin ln -sf ../../../bin/java-sablevm $(CURDIR)/debian/tmp/usr/lib/sablevm/bin/java ln -sf ../common-licenses/LGPL-2.1 \ $(CURDIR)/debian/tmp/usr/share/sablevm/COPYING.LIB install -p -m 0644 debian/sablevm.lintian \ $(CURDIR)/debian/sablevm/usr/share/lintian/overrides/sablevm # install jikes-sablevm wrapper cp -f $(CURDIR)/debian/jikes-sablevm.sh \ $(CURDIR)/debian/jikes-sablevm/usr/bin/jikes-sablevm chmod +x $(CURDIR)/debian/jikes-sablevm/usr/bin/jikes-sablevm binary-common: dh_testdir dh_testroot dh_movefiles # dh_installdebconf dh_installdocs # dh_installexamples # dh_installmenu # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit # dh_installcron # dh_installman # dh_installinfo # dh_undocumented dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms dh_makeshlibs dh_installdeb # dh_perl dh_shlibdeps echo "sablevm:VerCurrent=$(VERSION)" >> debian/libsablevm1.substvars echo "sablevm:VerExact=$(VERSION_EXACT)" >> debian/libsablevm1.substvars echo "sablevm:VerNext=$(VERSION_NEXT)" >> debian/libsablevm1.substvars echo "sablevm:VerCurrent=$(VERSION)" >> debian/sablevm.substvars echo "sablevm:VerExact=$(VERSION_EXACT)" >> debian/sablevm.substvars echo "sablevm:VerNext=$(VERSION_NEXT)" >> debian/sablevm.substvars dh_gencontrol dh_md5sums touch binary-common # Build architecture-independent files here. binary-indep: build install binary-common # We have nothing to do by default. dh_builddeb -i # Build architecture-dependent files here. binary-arch: build install binary-common dh_builddeb -a binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install