#!/usr/bin/make -f
# Build rules for the Debian package seaview.
# Modifications by Charles Plessy during the year 2006
# are hereby released as "public domain".


# 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)

PROGRAM_NAME	=	seaview

CFLAGS+=-Wall
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
        CFLAGS += -g
endif

build: build-stamp
build-stamp:
	dh_testdir
	$(MAKE) OPT="$(CFLAGS)                                                  \
	        -DPHYMLNAME=\\\"phyml\\\"                                       \
	        -DDEFAULT_HELPFILE=\\\"/usr/share/doc/seaview/seaview.html\\\"" \
	        $(PROGRAM_NAME)                                                 \
	        PNGJPEGLIBS='-lpng -ljpeg' FLTKLIBS='-lfltk -lfltk_images'
	touch build-stamp
	
clean: clean-patched
clean-patched:
	dh clean
	$(RM) *.o seaview seaviewps

install: build
	dh install

# Build architecture-dependent files here.
binary-arch: build install
	dh binary-arch

binary-indep:

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