#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 

# Pasted from Policy 4.9.1 :(but disabled parallel building).
CFLAGS = -Wall -g

ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
    CFLAGS += -O0
else
    CFLAGS += -O2
endif
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
    INSTALL_PROGRAM += -s
endif
#ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
#    NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
#    MAKEFLAGS += -j$(NUMJOBS)
#endif

build:
	dh build

clean:
	dh clean

binary-indep:
	dh binary-indep
binary-arch: 
	dh binary-arch

override_dh_auto_configure:
override_dh_auto_build:
	dh_testdir
	aclocal ; autoconf -f ; automake -f ; ./configure --prefix=/usr
	$(MAKE) CFLAGS="$(CFLAGS)"
	$(MAKE) prefix=`pwd`/debian/`dh_listpackages`/usr install
	$(MAKE) distclean
	aclocal ; autoconf -f ; automake -f ; ./configure --prefix=/usr --enable-phytime
	$(MAKE) CFLAGS="$(CFLAGS)"
	$(MAKE) prefix=`pwd`/debian/`dh_listpackages`/usr install
	touch build-stamp
override_dh_auto_install:

override_dh_prep:
	dh_prep -X debian/phyml

binary: binary-indep binary-arch

build-arch: build
build-indep:

.PHONY: build-arch build-indep clean binary-indep binary-arch binary
