Makefile 2.84 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
# this is <Makefile>
# ----------------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
3
# $Id$
thomas.forbriger's avatar
thomas.forbriger committed
4
5
6
7
# 
# Copyright (c) 2009 by Thomas Forbriger (BFO Schiltach) 
# 
# fidase: prepare a homogeneous data set from individual shot files
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#
# ----
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. 
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
# ----
thomas.forbriger's avatar
thomas.forbriger committed
24
25
26
# 
# REVISIONS and CHANGES 
#    08/04/2009   V1.0   Thomas Forbriger
thomas.forbriger's avatar
thomas.forbriger committed
27
#    15/11/2010   V1.1   reworked makefile; avoid makedoc.tcl and incdep
thomas.forbriger's avatar
thomas.forbriger committed
28
29
# 
# ============================================================================
30
#
thomas.forbriger's avatar
thomas.forbriger committed
31
32
33
34
35
36
37
 
all: fidase

CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))

$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
38

thomas.forbriger's avatar
thomas.forbriger committed
39
LINLIB=-lblas -llapack
thomas.forbriger's avatar
thomas.forbriger committed
40
41
PGPLOTLIB=$(TF_LINK_PGPLOT)
CFLAGS= -I${LOCINCLUDEDIR} 
thomas.forbriger's avatar
thomas.forbriger committed
42
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
thomas.forbriger's avatar
thomas.forbriger committed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

#----------------------------------------------------------------------

.PHONY: clean edit

flist: Makefile $(FIDAOBS:.o=.f) *.inc
	echo $< > $@
	echo $(FIDAOBS:.o=.f) | tr ' ' '\n' | sort >> $@
	echo *.inc | tr ' ' '\n' | sort >> $@

edit: flist; vim $<

clean:
	-/bin/rm *.o *.bak *.d

#----------------------------------------------------------------------
59
60

FIDAOBS=fidase.o fidase_readdata.o fidase_skipdata.o fidase_writedata.o \
thomas.forbriger's avatar
thomas.forbriger committed
61
62
  fidase_readtaper.o fidase_evaltaper.o fidase_enfit.o fidase_resamp.o \
  fidase_destack.o
63

thomas.forbriger's avatar
thomas.forbriger committed
64
#----------------------------------------------------------------------
65

thomas.forbriger's avatar
thomas.forbriger committed
66
67
68
%.d: %.f
	echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.o,%.d,$(FIDAOBS))
69

thomas.forbriger's avatar
thomas.forbriger committed
70
#----------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
71

thomas.forbriger's avatar
thomas.forbriger committed
72
73
74
75
76
77
78
79
fidase.doc: $(patsubst %.o,%.f,$(FIDAOBS))
	/usr/bin/awk 'BEGIN{ hot=0; } \
        /^cS/ { hot=1; \
	    print FILENAME; \
          print "  c\n  c"; \
          next; } \
        /^cE/ { hot=0; } \
        { if (hot==1) { print "  " $$0; } }' $^ > $@
thomas.forbriger's avatar
thomas.forbriger committed
80

thomas.forbriger's avatar
thomas.forbriger committed
81
#----------------------------------------------------------------------
82

thomas.forbriger's avatar
thomas.forbriger committed
83
84
%.o: %.f
	$(FC) -o $@ -c $< $(FFLAGS)
85
86

fidase: $(FIDAOBS)
thomas.forbriger's avatar
thomas.forbriger committed
87
	$(FC) -o fidase $(FIDAOBS) \
88
        -ltf -lts -lsffu -ltime_trad -lsff \
89
        $(PGPLOTLIB) $(LINLIB) \
thomas.forbriger's avatar
thomas.forbriger committed
90
91
        -L$(LOCLIBDIR) 
	/bin/mv -fv $@ $(LOCBINDIR)
92

thomas.forbriger's avatar
thomas.forbriger committed
93
# ----- END OF Makefile -----