Makefile 3.2 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
#    14/01/2011   V1.2   implemented fidasex with libfapidxx interface
thomas.forbriger's avatar
thomas.forbriger committed
29
30
# 
# ============================================================================
31
#
thomas.forbriger's avatar
thomas.forbriger committed
32
 
33
34
35
36
37
38
39
40
PROGRAMS=fidase fidasex

.PHONY: all
all: install fidase.doc

.PHONY: install
install: $(PROGRAMS)
	/bin/mv -fv $^ $(LOCBINDIR)
thomas.forbriger's avatar
thomas.forbriger committed
41
42
43
44
45

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

$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
46

thomas.forbriger's avatar
thomas.forbriger committed
47
LINLIB=-lblas -llapack
thomas.forbriger's avatar
thomas.forbriger committed
48
49
PGPLOTLIB=$(TF_LINK_PGPLOT)
CFLAGS= -I${LOCINCLUDEDIR} 
thomas.forbriger's avatar
thomas.forbriger committed
50
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
thomas.forbriger's avatar
thomas.forbriger committed
51
52
53
54
55
56
57
58
59
60
61
62
63

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

.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:
64
	-/bin/rm *.o *.bak *.d $(PROGRAMS)
thomas.forbriger's avatar
thomas.forbriger committed
65
66

#----------------------------------------------------------------------
67
68

FIDAOBS=fidase.o fidase_readdata.o fidase_skipdata.o fidase_writedata.o \
thomas.forbriger's avatar
thomas.forbriger committed
69
70
  fidase_readtaper.o fidase_evaltaper.o fidase_enfit.o fidase_resamp.o \
  fidase_destack.o
71

thomas.forbriger's avatar
thomas.forbriger committed
72
#----------------------------------------------------------------------
73

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

thomas.forbriger's avatar
thomas.forbriger committed
78
#----------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
79

thomas.forbriger's avatar
thomas.forbriger committed
80
81
82
83
84
85
86
87
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
88

thomas.forbriger's avatar
thomas.forbriger committed
89
#----------------------------------------------------------------------
90

thomas.forbriger's avatar
thomas.forbriger committed
91
92
%.o: %.f
	$(FC) -o $@ -c $< $(FFLAGS)
93
94

fidase: $(FIDAOBS)
thomas.forbriger's avatar
thomas.forbriger committed
95
	$(FC) -o $@ $^ \
96
        -ltf -lts -lsffu -ltime_trad -lsff \
97
        $(PGPLOTLIB) $(LINLIB) \
thomas.forbriger's avatar
thomas.forbriger committed
98
        -L$(LOCLIBDIR) 
99

thomas.forbriger's avatar
thomas.forbriger committed
100
101
102
103
104
105
106
fidasex: $(FIDAOBS)
	$(FC) -o $@ $^ \
        -ltf -lts -lsffu -ltime_trad  \
	  -lfapidxx -ldatrwxx -lsffxx -lgsexx -ltime++ -laff \
        $(PGPLOTLIB) $(LINLIB) \
        -L$(LOCLIBDIR) 

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