| 1 |
#!/usr/bin/make -f |
| 2 |
# -*- makefile -*- |
| 3 |
|
| 4 |
# Uncomment this to turn on verbose mode. |
| 5 |
#export DH_VERBOSE=1 |
| 6 |
include /usr/share/dpkg/buildtools.mk |
| 7 |
|
| 8 |
%: |
| 9 |
dh $@ |
| 10 |
|
| 11 |
ifeq (,$(wildcard /usr/lib/$(DEB_BUILD_MULTIARCH)/libfftw3l*)) |
| 12 |
FFTWDEF_FOR_BUILD=-DNO_LONG_DOUBLE_FFTW |
| 13 |
FFTWLIB_FOR_BUILD=-lfftw3 |
| 14 |
else |
| 15 |
FFTWLIB_FOR_BUILD=-lfftw3l |
| 16 |
endif |
| 17 |
ifeq (,$(wildcard /usr/lib/$(DEB_HOST_MULTIARCH)/libfftw3l*)) |
| 18 |
FFTWDEF=-DNO_LONG_DOUBLE_FFTW |
| 19 |
FFTWLIB=-lfftw3 |
| 20 |
else |
| 21 |
FFTWLIB=-lfftw3l |
| 22 |
endif |
| 23 |
|
| 24 |
override_dh_auto_build: |
| 25 |
$(CC_FOR_BUILD) $(CFLAGS) $(CPPFLAGS) $(FFTWDEF_FOR_BUILD) $(LDFLAGS) -o clencurt_gen clencurt_gen.c $(FFTWLIB_FOR_BUILD) -lm |
| 26 |
./clencurt_gen 19 > clencurt.h |
| 27 |
$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -c hcubature.c pcubature.c |
| 28 |
$(CC) $(LDFLAGS) -shared -o libcubature.so.0 -Wl,-soname,libcubature.so.0 hcubature.o pcubature.o -lm |
| 29 |
|
| 30 |
override_dh_auto_test: |
| 31 |
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) |
| 32 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o htest test.c hcubature.c -lm |
| 33 |
$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -DPCUBATURE -o ptest test.c pcubature.c -lm |
| 34 |
./htest 3 1e-5 0 |
| 35 |
./ptest 3 1e-5 0 |
| 36 |
./htest 3 1e-5 1 |
| 37 |
./ptest 3 1e-5 1 |
| 38 |
./htest 3 1e-5 3 |
| 39 |
./ptest 3 1e-5 3 |
| 40 |
./htest 3 1e-5 4 |
| 41 |
./ptest 3 1e-5 4 |
| 42 |
./htest 3 1e-5 5 |
| 43 |
./ptest 3 1e-5 5 |
| 44 |
./htest 3 1e-5 6 |
| 45 |
./ptest 3 1e-5 6 |
| 46 |
./htest 3 1e-5 7 |
| 47 |
./ptest 3 1e-5 7 |
| 48 |
endif |