#!/usr/bin/make -f # export DH_VERBOSE =1 OCTDIR=$(shell octave-config --print LOCALOCTFILEDIR) CGALVER=$(shell grep -o -E '\s[0-9]\.[0-9]+' /usr/include/CGAL/version.h) ifeq ($(shell expr $(CGALVER) \< 5.0), 1) CGALLIB=-lCGAL -lCGAL_ImageIO endif %: +dh $@ --buildsystem=octave override_dh_auto_configure: mkdir utils mkdir inst cp COPYING.txt COPYING cp ChangeLog.txt NEWS cp *.m inst cp *.fig inst cd inst; \ rm -rf base64decode.m base64encode.m fast_match_bracket.m gzipdecode.m gzipencode.m \ jdatadecode.m jdataencode.m jnifticreate.m loadjnifti.m loadjson.m loadmsgpack.m \ loadnifti.m loadubjson.m lz4decode.m lz4encode.m lz4hcdecode.m lz4hcencode.m lzipdecode.m \ lzipencode.m lzmadecode.m lzmaencode.m match_bracket.m nestbracket2dim.m nifticreate.m \ nii2jnii.m jnii2nii.m niicodemap.m niiformat.m readnifti.m savebnii.m savejnifti.m savejnii.m \ savemsgpack.m savenifti.m saveubjson.m zlibdecode.m zlibencode.m jsave.m jload.m savebj.m \ loadbj.m savejson.m isoctavemesh.m mergestruct.m jsonopt.m encodevarname.m decodevarname.m \ jdatahash.m jdict.m jsoncache.m jsonpath.m jsonset.m json2couch.m filterjsonmmap.m \ blosc2encode.m blosc2decode.m zstdencode.m zstddecode.m octavezmat.m FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) override_dh_auto_build: $(CXX) $(FLAGS) -g -O3 tools/cgalmesh/mesh_3D_image.cpp -o utils/cgalmesh $(CGALLIB) -lgmp -lmpfr $(CXX) $(FLAGS) -g -O3 tools/cgalmesh/mesh_polyhedral_domain.cpp -o utils/cgalpoly $(CGALLIB) -lgmp -lmpfr $(CXX) $(FLAGS) -g -O3 tools/cgalsurf/mesh_a_3d_gray_image.cpp -o utils/cgalsurf $(CGALLIB) -lgmp -lmpfr $(CXX) $(FLAGS) -g -O3 tools/cgalsimp2/edge_collapse_enriched_polyhedron.cpp -o utils/cgalsimp2 $(CGALLIB) -lgmp -lmpfr cd meshfix; \ rm -rf include/SuperLU; \ ln -sf /usr/include/superlu include/SuperLU; \ cmake . $(MAKE) -C meshfix mv meshfix/meshfix utils mv meshfix/contrib/JMeshLib/test_jmeshlib utils/jmeshlib override_dh_installchangelogs: dh_installchangelogs NEWS execute_after_dh_installdeb: @doc_dir=$(shell find debian/octave-iso2mesh -name doc -a -empty) ; \ if [ -n "$$doc_dir" ] ; then \ rmdir $$doc_dir ; \ else \ echo "****************************************************" ; \ echo "Please, remove the doc dir removal hack from d/rules" ; \ echo "****************************************************" ; \ fi