Makefile 8.12 KB
Newer Older
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
3
# $Id: Makefile,v 1.37 2006-06-29 07:11:44 tforb Exp $
4
5
6
7
# 
# Copyright (c) 2005 by Thomas Forbriger (BFO Schiltach) 
# 
# time series waveform filters
thomas.forbriger's avatar
thomas.forbriger committed
8
9
10
#
# Makefile fuer tools /src/ts/wf
#
thomas.forbriger's avatar
thomas.forbriger committed
11
# 22/01/2001      introduced smoos and did some "tidy up"
thomas.forbriger's avatar
thomas.forbriger committed
12
# 24/10/2001      introduced siggen
thomas.forbriger's avatar
thomas.forbriger committed
13
# 24/05/2001      introduced tsfilt
14
15
16
17
18
# 
# REVISIONS and CHANGES 
#    11/07/2005   V1.0   Thomas Forbriger
# 
# ============================================================================
thomas.forbriger's avatar
thomas.forbriger committed
19
#
20
21
22

F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
PGPLOTLIB=-lf2cpgplot52 -lX11 -L/usr/X11/lib
23
CC=gcc
24
25
26
CFLAGS=-O2
F2CFLAGS=-f -u

thomas.forbriger's avatar
thomas.forbriger committed
27
28
29
30
31
32
FLAGS=
CXXFLAGS=-fhonor-std -Wall $(FLAGS)
CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)

33
34
35
36
37
.f.o:
	f2c $(F2CFLAGS) $<
	gcc $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
	@rm  $(<:.f=.c)

38
39
40
41
42
all:

.PHONY: clean
clean: ; 
	-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
thomas.forbriger's avatar
thomas.forbriger committed
43
	-/bin/rm -vf flist *.o *.xxx.* *.ps *~
44
45
46
47

flist: $(wildcard *.f *.inc Makefile *.cc)
	echo $^ | tr ' ' '\n' | sort > $@

thomas.forbriger's avatar
thomas.forbriger committed
48
49
50
.PHONY: edit
edit: flist; vim $<

thomas.forbriger's avatar
thomas.forbriger committed
51
52
53
54
55
tsfilt: tsfilt.o
	$(CC) $(CFLAGS) $< -o $@ -lseife -ltf \
        $(F2CLIB) -L$(LOCLIBDIR) -static
	newprog $@

thomas.forbriger's avatar
thomas.forbriger committed
56
stufi: stufi.o
57
	$(CC) $(CFLAGS) $< -o $@ -lseife -ltf -lsff \
58
        $(F2CLIB) -L$(LOCLIBDIR) -static
thomas.forbriger's avatar
thomas.forbriger committed
59
60
	newprog $@

thomas.forbriger's avatar
thomas.forbriger committed
61
rotate coro xyz2uvw detect: %: %.o
thomas.forbriger's avatar
thomas.forbriger committed
62
	$(CC) $(CFLAGS) $< -o $@ -lsff $(F2CLIB) -L$(LOCLIBDIR) -ltf
63
64
	newprog $@

thomas.forbriger's avatar
thomas.forbriger committed
65
susei evelo tesiff teswf: %: %.o
66
	$(CC) $(CFLAGS) $< -o $@ -ltf -lsff $(F2CLIB) -L$(LOCLIBDIR)
67
	newprog $@
thomas.forbriger's avatar
thomas.forbriger committed
68

thomas.forbriger's avatar
thomas.forbriger committed
69
phasedsignals hamres siggen smoos dise: %: %.o
70
	$(CC) $(CFLAGS) $< -o $@ -ltf -lsffu -ltime -lsff $(F2CLIB) \
71
           -L$(LOCLIBDIR)
72
73
	newprog $@

74
75
noisymize teseco resaseda gatherdiff autocorr cross tidofi fredofi sigfit: \
  %: %.o
thomas.forbriger's avatar
thomas.forbriger committed
76
	$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lsffxx -ldatreadxx -llinearxx \
thomas.forbriger's avatar
thomas.forbriger committed
77
                  -ltsxx -ltfxx -lsffxx -lgsexx -ltime++ -laff \
thomas.forbriger's avatar
thomas.forbriger committed
78
                  -llapack -lblas -lcseife -lsffxx -lg2c -lm\
79
                  -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
thomas.forbriger's avatar
thomas.forbriger committed
80
	newprog $@
81

thomas.forbriger's avatar
thomas.forbriger committed
82
phasetest%.sff: phasedsignals
thomas.forbriger's avatar
works    
thomas.forbriger committed
83
84
	phasedsignals $@ -v -o -p $(patsubst phasetest%.sff,%,$@) -n 16 \
        -t 10. -b 3. -s 0. -O 2 -N 6 -h 0.5
thomas.forbriger's avatar
thomas.forbriger committed
85
86
87
88
89
90
91
P%.sff: %.sff; evelo $< $@ -P

%.s.ps: %.sff; splot $< 0. $@/ps 1.e-2

RVAL=0.
%.ps: %.sff; stuplo -d $@/ps -R $(RVAL) $<
%.psp: %.ps; gv $<; /bin/rm -fv $<
92
93
94
95

#======================================================================
# test section

thomas.forbriger's avatar
thomas.forbriger committed
96
97
98
99
100
101
102
103
#----------------------------------------------------------------------
# test teseco
t1_sig.xxx.sff:
	/bin/rm -fv $@
	tesiff $@
t1_sig.xxx.ps: t1_sig.xxx.sff
	stuplo -d $@/cps -t -a -s x -i -Y 0.6 -V -c fTdtF \
        -X "Zeit (UT)" -l 3,2,1 -h 1.,1.,1.4,1.3 $<
thomas.forbriger's avatar
thomas.forbriger committed
104
t1_teseco1.xxx.sff: t1_sig.xxx.sff
thomas.forbriger's avatar
thomas.forbriger committed
105
	teseco -v -o $@ $< t:3-5 $< t:3,5 $< t:4
thomas.forbriger's avatar
thomas.forbriger committed
106
107
108
109
t1_teseco2.xxx.sff: t1_sig.xxx.sff
	teseco -v -o $@ $< t:3-5 $< f:-3. t:5 $< f:0.7 t:4 $< t:3 f:0.7
t1_teseco1.xxx.ps t1_teseco2.xxx.ps: \
  t1_teseco%.xxx.ps: t1_sig.xxx.sff t1_teseco%.xxx.sff
thomas.forbriger's avatar
thomas.forbriger committed
110
111
112
	stuplo -d $@/cps -t -a -s x -i -Y 0.6 -V -c fTdtF \
        -X "Zeit (UT)" -l 3,2,1 -h 1.,1.,1.4,1.3 -C \
        $(word 1,$^) t:3-5 nc: $(word 2,$^)
113
114
115

#----------------------------------------------------------------------
# test tidofi against stufi
thomas.forbriger's avatar
thomas.forbriger committed
116
sig.xxx.sff: ;siggen 6 $@  -Tm 0.2 -Te 1.
117

thomas.forbriger's avatar
thomas.forbriger committed
118
tid.t.xxx.fil tid.s.xxx.fil: ; echo -e "DBG  0\ntid  270\nend" > $@
119
120
121
122
lpb.t.xxx.fil lpb.s.xxx.fil: ; echo -e "DBG  0\nlpb  0.05,5\nend" > $@
hpb.t.xxx.fil hpb.s.xxx.fil: ; echo -e "DBG  0\nhpb  0.05,5\nend" > $@
lp2.t.xxx.fil lp2.s.xxx.fil: ; echo -e "DBG  0\nlp2  0.2,0.707\nend" > $@
hp2.t.xxx.fil hp2.s.xxx.fil: ; echo -e "DBG  0\nhp2  0.2,0.707\nend" > $@
thomas.forbriger's avatar
thomas.forbriger committed
123
124
125
126
127
bp2.t.xxx.fil bp2.s.xxx.fil: ; echo -e "DBG  0\nbp2  0.2,0.707\nend" > $@
he2.t.xxx.fil he2.s.xxx.fil: ; echo -e "DBG  0\nhe2  0.2,0.707,1.,0.1\nend" > $@
le2.t.xxx.fil le2.s.xxx.fil: ; echo -e "DBG 0\nle2  0.2,0.707,.01,0.1\nend" > $@
he1.t.xxx.fil he1.s.xxx.fil: ; echo -e "DBG  0\nhe1  0.2,1.,0.1\nend" > $@
le1.t.xxx.fil le1.s.xxx.fil: ; echo -e "DBG 0\nle1  0.2,.01,0.1\nend" > $@
128
129
lp1.t.xxx.fil lp1.s.xxx.fil: ; echo -e "DBG  0\nlp1  0.2\nend" > $@
hp1.t.xxx.fil hp1.s.xxx.fil: ; echo -e "DBG  0\nhp1  0.2\nend" > $@
thomas.forbriger's avatar
thomas.forbriger committed
130
131
fac.t.xxx.fil fac.s.xxx.fil: ; echo -e "DBG  0\nfac  -10.\nend" > $@
add.t.xxx.fil add.s.xxx.fil: ; echo -e "DBG  0\nadd  -1.e2\nend" > $@
thomas.forbriger's avatar
thomas.forbriger committed
132
133
add1.t.xxx.fil add1.s.xxx.fil: ; echo -e "DBG  0\nadd  -1.e-1\nend" > $@
add2.t.xxx.fil add2.s.xxx.fil: ; echo -e "DBG  0\nadd  +1.e-1\nend" > $@
thomas.forbriger's avatar
thomas.forbriger committed
134
rev.t.xxx.fil rev.s.xxx.fil: ; echo -e "DBG  0\nrev  200\nend" > $@
thomas.forbriger's avatar
thomas.forbriger committed
135
136
137
# 0.2/(2*pi)=0.031830989
dif.t.xxx.fil dif.s.xxx.fil: ; echo -e "DBG  0\ndif  0.031830989\nend" > $@
int.t.xxx.fil int.s.xxx.fil: ; echo -e "DBG  0\nint  0.031830989\nend" > $@
thomas.forbriger's avatar
thomas.forbriger committed
138
139
avg.t.xxx.fil avg.s.xxx.fil: ; echo -e "DBG  0\navg  30\nend" > $@
tre.t.xxx.fil tre.s.xxx.fil: ; echo -e "DBG  0\ntre  100\nend" > $@
140
141
han.t.xxx.fil: ; echo -e "DBG  0\nhan  0\nend" > $@
han.s.xxx.fil: ; echo -e "DBG  0\nsis  1,2000000\nend" > $@
thomas.forbriger's avatar
thomas.forbriger committed
142
143
144
145
first.t.xxx.fil: ; echo -e "DBG  0\nfirst  0\nend" > $@
first.s.xxx.fil: ; echo -e "DBG  0\navg 1\nend" > $@
fbl.t.xxx.fil: ; echo -e "DBG  0\nfbl 0,00,600\nend" > $@
fbl.s.xxx.fil: ; echo -e "DBG  0\nfbl 200,20,600\nend" > $@
146
147
148
149
150
151
152
153
154
155
156

%.xxx.rules: Makefile
	( echo "%.$(patsubst %.xxx.rules,%,$@).s.xxx.sff:" \
             " %.xxx.sff $(patsubst %.xxx.rules,%,$@).s.xxx.fil"; \
        echo -e '\tstufi $$(word 2,$$^) -v -o $$< ' \
                '>$$(patsubst %.sff,%.out,$$@) 2>&1'; \
        echo -e '\t/bin/mv -fv $$<.sfi $$@'; \
	  echo "%.$(patsubst %.xxx.rules,%,$@).t.xxx.sff:" \
             " %.xxx.sff $(patsubst %.xxx.rules,%,$@).t.xxx.fil"; \
        echo -e '\ttidofi -cf $$(word 2,$$^)' \
                '-v -o $$@ $$< ' \
thomas.forbriger's avatar
thomas.forbriger committed
157
158
159
160
161
162
163
164
165
166
                '>$$(patsubst %.sff,%.out,$$@) 2>&1'; \
        echo "%.$(patsubst %.xxx.rules,%,$@).t.xxx.fil:" \
             " $(patsubst %.xxx.rules,%,$@).t.xxx.fil" \
             '; /bin/ln -sfv $$< $$@'; \
        echo "%.$(patsubst %.xxx.rules,%,$@).s.xxx.fil:" \
             " $(patsubst %.xxx.rules,%,$@).s.xxx.fil" \
             '; /bin/ln -sfv $$< $$@'; \
        ) > $@

FILTERS=lp2 hp2 lp1 hp1 fac add rev dif int avg tre hpb lpb han bp2 he2 le2 \
thomas.forbriger's avatar
thomas.forbriger committed
167
  he1 le1 tid first fbl add1 add2
thomas.forbriger's avatar
thomas.forbriger committed
168
169

ifdef filters
170
include $(addsuffix .xxx.rules,$(FILTERS))
thomas.forbriger's avatar
thomas.forbriger committed
171
endif
172
173
174
175
176
177

REF=sig.xxx.sff
cmp.%.ps: %.s.xxx.sff %.t.xxx.sff $(REF)
	stuplo -d $@/cps -C -t -s x -i -c fT -l 3,2,1 -h 1.,1.2,1.4,1.2 \
        -Y 0.8 -V -X "Zeit (s)" \
        $(word 1,$^) nc: $(word 2,$^) nc: $(word 3,$^) $^
thomas.forbriger's avatar
thomas.forbriger committed
178
179
180
181
182
183
184
185
186
control.%.xxx.out: %.s.xxx.sff %.t.xxx.sff %.s.xxx.fil %.t.xxx.fil
	tail -999 $(patsubst %.sff,%.out,$^) > $@
control.%.ps: control.%.xxx.out
	cat $< \
	  | a2ps -A virtual -o $@ -1 -r -l 100 \
          --center-title="Control files for $(patsubst control.%,cmp.%,$@)"

report.%.ps: cmp.%.rw.ps control.%.ps
	a2ps -A virtual -o $@ -1 $^ 
187

thomas.forbriger's avatar
thomas.forbriger committed
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#----------------------------------------------------------------------
# test equivalence of lp2, hp2 and bp2
sig1.xxx.sff:
	siggen 5 $@ -v -o -f1 0.01 -f2 10. -n 50 -T 10. -d 0.001
eq2.ps: sig1.bp2.t.xxx.sff sig1.lp2.t.dif.t.xxx.sff sig1.hp2.t.int.t.xxx.sff \
        sig1.lp2.t.dif.t.add1.t.xxx.sff sig1.hp2.t.int.t.add2.t.xxx.sff
	stuplo -d $@/cps -C -t -s x -i -c fT -l 3,2,1 -h 1.,1.2,1.4,1.2 \
        -Y 0.8 -V -X "Zeit (s)" \
        $(word 5,$^) $(wordlist 1,5,$^)  \
        nc: $(word 4,$^) $(wordlist 1,4,$^) \
        nc: $(word 3,$^) $(wordlist 1,3,$^) \
        nc: $(word 2,$^) $(wordlist 1,2,$^) \
        nc: $(word 1,$^) $(wordlist  1,1,$^)

thomas.forbriger's avatar
thomas.forbriger committed
202
203
204
205
206
207
208
209
210
211
212
#----------------------------------------------------------------------
# test resampling algorithm
rsa.xxx.sff:
	siggen 5 $@ -v -o -f1 1.e-5 -f2 20.e-3 -n 10 -T 1.e3 -d 10.
rsa.xxx.rsa.sff: rsa.xxx.sff
	resaseda -v -o -tf 2001/2/9/0/1/1.23 -dt 0.05 $@ $<
rsa.ps: rsa.xxx.sff rsa.xxx.rsa.sff
	stuplo -d $@/cps -t -a \
        -c dtfT -s x -i -l 3,2,1 -h 1.3,1.3,1.3,1.3 -N -C \
        $(word 1,$^) nc: $(word 2,$^)

thomas.forbriger's avatar
thomas.forbriger committed
213
214
#----------------------------------------------------------------------

215
%.psp: %.ps; gv $<; /bin/rm -fv $<
thomas.forbriger's avatar
thomas.forbriger committed
216
217
218
219
220
221
%.pdf: %.ps; ps2pdf $<
%.rw.ps: %.ps; gs -sDEVICE=pswrite -dNOPAUSE -dBATCH -sOutputFile=$@ $< 
%.fix.ps: %.ps; fixps $< > $@
%.2up.ps: %.ps; psnup -r -l -2 -Pa4 -pa4 $< > $@
%.rs.ps: %.ps; psresize -Pa4 -pa5 $< > $@
%.pngp: %.png; xv $<; /bin/rm -fv $<
222
223

# ----- END OF Makefile -----