#!/usr/bin/make -f

# The magic debhelper  rule
%:
	dh $@

CFLAGS += -fPIC

ARCH:=$(shell dpkg --print-architecture)
WITH_GRIB:= --with-grib-api=/usr

ifeq ($(ARCH), mips)
  WITH_GRIB:=
endif
ifeq ($(ARCH), hppa)
  WITH_GRIB:=
endif
ifeq ($(ARCH), sparc)
  WITH_GRIB:=
endif

override_dh_auto_clean:
	dh_auto_clean	
	find . -name Makefile.in -delete
	rm -f src/config.h.in aclocal.m4 config/depcomp config/install-sh config/ltmain.sh config/missing configure INSTALL

override_dh_auto_configure:
	autoreconf -if
	./configure --prefix=/usr --with-zlib=/usr --with-jasper=/usr --with-netcdf=/usr  --with-proj=/usr --with-hdf5=/usr  $(WITH_GRIB)

