1# The threads stuff is only compiled if FFTW was configured with
2# the --enable-threads option.  This requires us to use the combination
3# of foo_* and EXTRA_* variables below.
4
5lib_LTLIBRARIES = @FFTW_THREADS_LIBLIST@
6include_HEADERS = @FFTW_THREADS_INCLUDELIST@
7noinst_PROGRAMS = @FFTW_THREADS_PROGLIST@
8
9EXTRA_LTLIBRARIES = lib@FFTW_PREFIX@fftw_threads.la \
10                    lib@FFTW_PREFIX@rfftw_threads.la
11EXTRA_HEADERS = @FFTW_PREFIX@fftw_threads.h \
12                @FFTW_PREFIX@rfftw_threads.h
13EXTRA_PROGRAMS = fftw_threads_test rfftw_threads_test
14
15FFTWDIR=../fftw
16RFFTWDIR=../rfftw
17INCLUDES = -I$(srcdir)/../tests \
18           -I$(srcdir)/$(FFTWDIR) -I$(srcdir)/$(RFFTWDIR) -I$(srcdir)
19
20
21lib@FFTW_PREFIX@fftw_threads_la_SOURCES = \
22                             executor_threads.c fftw_threads.c \
23                             fftwnd_threads.c \
24                             fftw_f77_threads.c \
25	                     @FFTW_PREFIX@fftw_threads.h \
26                             fftw_threads-int.h
27lib@FFTW_PREFIX@fftw_threads_la_LDFLAGS = \
28                             -version-info @SHARED_VERSION_INFO@ \
29                             -rpath $(libdir)
30
31@FFTW_PREFIX1@fftw_threads.h: fftw_threads.h
32	rm -f $@
33	sed 's/\"fftw/\"@FFTW_PREFIX@fftw/g;s/\"rfftw/\"@FFTW_PREFIX@rfftw/g' $(srcdir)/fftw_threads.h > $@
34
35fftw_threads_test_SOURCES = fftw_threads_test.c
36fftw_threads_test_LDADD = ../tests/test_main.o \
37	                  lib@FFTW_PREFIX@fftw_threads.la \
38                          $(FFTWDIR)/lib@FFTW_PREFIX@fftw.la \
39	 		  @THREADLIBS@
40
41lib@FFTW_PREFIX@rfftw_threads_la_SOURCES = \
42                              rexec_threads.c rexec2_threads.c \
43			      rfftwnd_threads.c \
44                              rfftw_f77_threads.c \
45	                      @FFTW_PREFIX@fftw_threads.h \
46                              fftw_threads-int.h \
47                              @FFTW_PREFIX@rfftw_threads.h
48lib@FFTW_PREFIX@rfftw_threads_la_LDFLAGS = \
49                              -version-info @SHARED_VERSION_INFO@ \
50                              -rpath $(libdir)
51
52@FFTW_PREFIX1@rfftw_threads.h: rfftw_threads.h
53	rm -f $@
54	sed 's/\"fftw/\"@FFTW_PREFIX@fftw/g;s/\"rfftw/\"@FFTW_PREFIX@rfftw/g' $(srcdir)/rfftw_threads.h > $@
55
56CLEANFILES = @FFTW_PREFIX1@fftw_threads.h \
57             @FFTW_PREFIX1@rfftw_threads.h
58
59rfftw_threads_test_SOURCES = rfftw_threads_test.c
60rfftw_threads_test_LDADD = ../tests/test_main.o \
61	                  lib@FFTW_PREFIX@rfftw_threads.la \
62                          lib@FFTW_PREFIX@fftw_threads.la \
63                          $(RFFTWDIR)/lib@FFTW_PREFIX@rfftw.la \
64                          $(FFTWDIR)/lib@FFTW_PREFIX@fftw.la \
65			  @THREADLIBS@
66
67# for some reason, automake tries to use autoheader in order to
68# generate config.h.in, and fails because config.h.in is GNU-lly
69# incorrect.  Just disable autoheader
70AUTOHEADER=echo
71
72check: @FFTW_THREADS_PROGLIST@
73	@set fnord $(MAKEFLAGS); amf=$$2; \
74        list='@FFTW_THREADS_PROGLIST@'; for prog in $$list; do \
75          target="$$prog""-check"; \
76          echo "Making $$target"; \
77          ($(MAKE) $$target) \
78           || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
79        done && test -z "$$fail"
80
81fftw_threads_test-check: fftw_threads_test
82	./fftw_threads_test 1 -x 100 -r 0
83	./fftw_threads_test 2 -x 100 -r 0
84	./fftw_threads_test 3 -x 100 -r 0
85	./fftw_threads_test 10 -x 100 -r 0
86	@echo "--------------------------------------------------------------"
87	@echo "    FFTW complex-complex threads transforms passed tests!"
88	@echo "--------------------------------------------------------------"
89
90rfftw_threads_test-check: rfftw_threads_test
91	./rfftw_threads_test 1 -x 100 -r 0
92	./rfftw_threads_test 2 -x 100 -r 0
93	./rfftw_threads_test 3 -x 100 -r 0
94	./rfftw_threads_test 10 -x 100 -r 0
95	@echo "--------------------------------------------------------------"
96	@echo "     RFFTW real-complex threads transforms passed tests!"
97	@echo "--------------------------------------------------------------"
98