#!/usr/bin/make -f DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) VENDOR := $(shell dpkg-vendor --derives-from Ubuntu && echo Ubuntu || echo Debian) CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS) CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS) CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS) LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) export DEB_BUILD_MAINT_OPTIONS = hardening=+all # less debug info to avoid running out of address space during build ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel)) export DEB_CXXFLAGS_MAINT_APPEND = -g1 endif %: dh $@ export FOAM_APP=$(CURDIR)/applications export FOAM_SOLVERS=$(CURDIR)/applications/solvers export FOAM_APPBIN=$(CURDIR)/platforms/linux64Gcc/bin export FOAM_LIBBIN=$(CURDIR)/platforms/linux64Gcc/lib export FOAM_EXT_LIBBIN=$(CURDIR)/platforms/linux64Gcc/lib export FOAM_MPI=openmpi-system export FOAM_RUN=$(CURDIR)/run export FOAM_SRC=$(CURDIR)/src export FOAM_ETC=$(CURDIR)/etc export FOAM_USER_APPBIN=$(CURDIR)/platforms/linux64Gcc/bin export FOAM_USER_LIBBIN=$(CURDIR)/platforms/linux64Gcc/lib export MPI_ARCH_PATH=/usr/include/openmpi export WM_ARCH=linux64 export WM_LABEL_SIZE=32 export WM_LABEL_OPTION=Int32 export WM_COMPILER=Gcc export WM_COMPILER_LIB_ARCH=64 export WM_COMPILE_OPTION=Opt export WM_DIR=$(CURDIR)/wmake export WM_OPTIONS=linux64Gcc export WM_PRECISION_OPTION=DP export WM_PROJECT=OpenFOAM export WM_PROJECT_DIR=$(CURDIR) export WM_PROJECT_USER_DIR=$(CURDIR)/debian/tmp export WM_PROJECT_VERSION="$(bin/foamEtcFile -show-api)" export gperftools_install=$(CURDIR)/platforms/linux64Gcc export WM_MPLIB=SYSTEMOPENMPI unexport FOAMY_HEX_MESH unexport MAKEFLAGS NUMJOBS := 1 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS := $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif # Limit parallel build to 2 processes on Ubuntu ifeq ($(VENDOR),Ubuntu) NUMJOBS := $(shell if test $(NUMJOBS) -gt 2; then echo 2 ; else echo $(NUMJOBS); fi) endif export WM_NCOMPPROCS=$(NUMJOBS) export LD_LIBRARY_PATH:=$(CURDIR)/platforms/linux64Gcc/lib/openmpi-system:/usr/lib/openmpi/lib:$(CURDIR)/platforms/linux64Gcc/lib:$(CURDIR)/platforms/linux64Gcc/lib:$(CURDIR)/platforms/linux64Gcc/lib/dummy:$(LD_LIBRARY_PATH); override_dh_clean: # OpenFOAM uses .orig as a control file extension dh_clean -X "*.orig" override_dh_auto_configure: if [ -x bin/tools/foamConfigurePaths ]; then \ bin/tools/foamConfigurePaths \ -boost boost-system \ -cgal cgal-system \ -fftw fftw-system \ -kahip kahip-none \ -scotch scotch-system \ ; \ fi override_dh_auto_build: PATH=$(PATH):$(CURDIR)/wmake ./Allwmake -j$(NUMJOBS) if [ -x bin/tools/foamCreateManpage ]; then \ bin/tools/foamCreateManpage -gzip -version "$(bin/foamEtcFile -show-api)" || \ echo "ignore problems generating manpages"; \ fi override_dh_missing-arch: dh_missing --list-missing