123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- PYTHON=`which python3`
- DESTDIR=/
- PROJECT=python-scattnlay
- VERSION=2.3
- BUILDIR=$(CURDIR)/debian/$(PROJECT)
- SRCDIR=$(CURDIR)/src
- MULTIPREC=100
- CXX_NMIE_HEADERS=$(SRCDIR)/nmie.hpp $(SRCDIR)/nmie-basic.hpp $(SRCDIR)/nmie-nearfield.hpp $(SRCDIR)/nmie-precision.hpp
- all:
- @echo "make source - Create source package for Python extension"
- @echo "make ext - Create Python extension in place"
- @echo "make install - Install Python extension on local system"
- @echo "make rpm - Generate a rpm package for Python extension"
- @echo "make deb - Generate a deb package for Python extension"
- @echo "make standalone - Create standalone programs (scattnlay and fieldnlay)"
- @echo "make clean - Delete temporal files"
- source:
- $(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../
- ext: $(SRCDIR)/pb11_wrapper.cc $(CXX_NMIE_HEADERS)
- $(PYTHON) setup.py build_ext --inplace
- install:
- $(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)
- rpm:
-
- $(PYTHON) setup.py bdist_rpm --dist-dir=../
- deb: source
-
-
- rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*
-
- dpkg-buildpackage -i -I -rfakeroot
- standalone: scattnlay-dp fieldnlay-dp scattnlay-mp fieldnlay-mp
- scattnlay-dp: $(SRCDIR)/farfield.cc $(SRCDIR)/nmie.cc $(CXX_NMIE_HEADERS)
- $(CXX) -DNDEBUG -O2 -Wall -std=c++11 $(SRCDIR)/farfield.cc $(SRCDIR)/nmie.cc -lm -o scattnlay-dp $(CXXFLAGS) $(LDFLAGS)
- fieldnlay-dp: $(SRCDIR)/nearfield.cc $(SRCDIR)/nmie.cc $(CXX_NMIE_HEADERS)
- $(CXX) -DNDEBUG -O2 -Wall -std=c++11 $(SRCDIR)/nearfield.cc $(SRCDIR)/nmie.cc -lm -o fieldnlay-dp $(CXXFLAGS) $(LDFLAGS)
- scattnlay-mp: $(SRCDIR)/farfield.cc $(SRCDIR)/nmie.cc $(CXX_NMIE_HEADERS)
- $(CXX) -DNDEBUG -DMULTI_PRECISION=$(MULTIPREC) -O2 -Wall -std=c++11 $(SRCDIR)/farfield.cc $(SRCDIR)/nmie.cc -lm -o scattnlay-mp $(CXXFLAGS) $(LDFLAGS)
- fieldnlay-mp: $(SRCDIR)/nearfield.cc $(SRCDIR)/nmie.cc $(CXX_NMIE_HEADERS)
- $(CXX) -DNDEBUG -DMULTI_PRECISION=$(MULTIPREC) -O2 -Wall -std=c++11 $(SRCDIR)/nearfield.cc $(SRCDIR)/nmie.cc -lm -o fieldnlay-mp $(CXXFLAGS) $(LDFLAGS)
- wasm: $(SRCDIR)/nmie-js-wrapper.cc $(CXX_NMIE_HEADERS)
-
-
-
-
-
- emcc --bind -lm -Wall -pedantic -O2 -std=c++11 \
- -s EXPORT_ES6=1 \
- -s NO_DISABLE_EXCEPTION_CATCHING \
- -s MODULARIZE=1 \
- -s ASSERTIONS=1 \
- -s WASM=1 \
- -s ALLOW_MEMORY_GROWTH=1 \
- -s EXPORT_NAME="createNmiejsModule" \
- -s ENVIRONMENT="web" \
- -o nmiejs.js $(SRCDIR)/nmie-js-wrapper.cc
- @cp -f nmiejs.js guiapp/src/
- @cp -f nmiejs.wasm guiapp/public/
- @cp -f nmiejs.wasm guiapp/src/
- clean:
- $(PYTHON) setup.py clean
- $(MAKE) -f $(CURDIR)/debian/rules clean
- rm -rf build/ MANIFEST
- find . -name '*.pyc' -delete
- find . -name '*.o' -delete
- find . -name '*.so' -delete
|