Makefile 4.45 KB
Newer Older
1
2
3
4
5
6
7
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.28 2005-07-11 14:29:34 tforb Exp $
# 
# 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

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


#----------------------------------------------------------------------
# test tidofi against stufi
sig.xxx.sff: ;siggen 13 $@

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" > $@
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" > $@
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  10.\nend" > $@
rev.t.xxx.fil rev.s.xxx.fil: ; echo -e "DBG  0\nrev  0\nend" > $@
dif.t.xxx.fil dif.s.xxx.fil: ; echo -e "DBG  0\ndif  0\nend" > $@
int.t.xxx.fil int.s.xxx.fil: ; echo -e "DBG  0\nint  0\nend" > $@
avg.t.xxx.fil avg.s.xxx.fil: ; echo -e "DBG  0\navg  0\nend" > $@
tre.t.xxx.fil tre.s.xxx.fil: ; echo -e "DBG  0\ntre  0\nend" > $@
han.t.xxx.fil: ; echo -e "DBG  0\nhan  0\nend" > $@
han.s.xxx.fil: ; echo -e "DBG  0\nsis  1,2000000\nend" > $@

%.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 $$@ $$< ' \
                '>$$(patsubst %.sff,%.out,$$@) 2>&1' ) > $@

FILTERS=lp2 hp2 lp1 hp1 fac add rev dif int avg tre hpb lpb han
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,$^) $^

%.psp: %.ps; gv $<; /bin/rm -fv $<

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