Makefile 6.08 KB
Newer Older
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
3
# $Id: Makefile,v 1.29 2005-07-11 17:14:56 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
43
44
45
46
47
all:

.PHONY: clean
clean: ; 
	-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
	-/bin/rm -vf flist *.o *.xxx.*

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 $@

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

thomas.forbriger's avatar
thomas.forbriger committed
81
phasetest%.sff: phasedsignals
thomas.forbriger's avatar
works    
thomas.forbriger committed
82
83
	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
84
85
86
87
88
89
90
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 $<
91
92
93
94
95
96
97

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


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

thomas.forbriger's avatar
thomas.forbriger committed
100
tid.t.xxx.fil tid.s.xxx.fil: ; echo -e "DBG  0\ntid  270\nend" > $@
101
102
103
104
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
105
106
107
108
109
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" > $@
110
111
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
112
113
114
115
116
117
118
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" > $@
rev.t.xxx.fil rev.s.xxx.fil: ; echo -e "DBG  0\nrev  200\nend" > $@
dif.t.xxx.fil dif.s.xxx.fil: ; echo -e "DBG  0\ndif  0.01\nend" > $@
int.t.xxx.fil int.s.xxx.fil: ; echo -e "DBG  0\nint  .1\nend" > $@
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" > $@
119
120
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
121
122
123
124
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" > $@
125
126
127
128
129
130
131
132
133
134
135

%.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
136
137
138
139
140
141
142
143
144
145
146
                '>$$(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 \
  he1 le1 tid first fbl
147
148
149
150
151
152
153
include $(addsuffix .xxx.rules,$(FILTERS))

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
154
155
156
157
158
159
160
161
162
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 $^ 
163
164

%.psp: %.ps; gv $<; /bin/rm -fv $<
thomas.forbriger's avatar
thomas.forbriger committed
165
166
167
168
169
170
%.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 $<
171
172

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