1#! /bin/sh
2
3# This file generates the FFTW makefile, starting from Makefile.fftw.am.
4# It also generates the rfftw makefile.
5
6. ./config
7
8###########################################################################
9
10# Compute the list of file names
11notw_codelets=""
12notwi_codelets=""
13
14for i in $NOTW
15do
16    notw_codelets="$notw_codelets ${NOTW_PREFIX}${i}.c"
17    notwi_codelets="$notwi_codelets ${NOTWI_PREFIX}${i}.c"
18done
19
20twiddle_codelets=""
21twiddlei_codelets=""
22
23for i in $TWIDDLE
24do
25    twiddle_codelets="$twiddle_codelets ${TWID_PREFIX}${i}.c"
26    twiddlei_codelets="$twiddlei_codelets ${TWIDI_PREFIX}${i}.c"
27done
28
29# now substitute list in Makefile.fftw.am, to get Makefile.fftw
30# (the two cats are redundant, but the script is clearer this way)
31cat Makefile.fftw.am |
32    sed -e "s/@NOTW_CODELETS@/$notw_codelets/g" |
33    sed -e "s/@NOTWI_CODELETS@/$notwi_codelets/g" |
34    sed -e "s/@TWID_CODELETS@/$twiddle_codelets/g" |
35    sed -e "s/@TWIDI_CODELETS@/$twiddlei_codelets/g" |
36cat >Makefile.fftw
37
38###########################################################################
39
40# Compute the list of file names
41notw_codelets=""
42notwi_codelets=""
43
44for i in $NOTW_REAL
45do
46    notw_codelets="$notw_codelets ${REAL2HC_PREFIX}${i}.c"
47    notwi_codelets="$notwi_codelets ${HC2REAL_PREFIX}${i}.c"
48done
49
50twiddle_codelets=""
51twiddlei_codelets=""
52
53for i in $TWIDDLE_REAL
54do
55    twiddle_codelets="$twiddle_codelets ${HC2HC_FORWARD_PREFIX}${i}.c"
56    twiddlei_codelets="$twiddlei_codelets ${HC2HC_BACKWARD_PREFIX}${i}.c"
57done
58
59# now substitute list in Makefile.rfftw.am, to get Makefile.rfftw
60# (the two cats are redundant, but the script is clearer this way)
61cat Makefile.rfftw.am |
62    sed -e "s/@NOTW_CODELETS@/$notw_codelets/g" |
63    sed -e "s/@NOTWI_CODELETS@/$notwi_codelets/g" |
64    sed -e "s/@TWID_CODELETS@/$twiddle_codelets/g" |
65    sed -e "s/@TWIDI_CODELETS@/$twiddlei_codelets/g" |
66cat >Makefile.rfftw
67