Makefile 3.44 KB
Newer Older
thomas.forbriger's avatar
thomas.forbriger committed
1
2
3
4
5
6
7
8
9
# this is <Makefile>
# ----------------------------------------------------------------------------
# 
# Copyright (c) 2010 by Thomas Forbriger (BFO Schiltach) 
# 
# a common Makefile for Erhards code
# 
# REVISIONS and CHANGES 
#    01/11/2010   V1.0   Thomas Forbriger
10
11
#    30/11/2010   V1.1   provide all targets; use calexew additionally, since
#                        calex conflicts with SFF version of calex
12
#    07/08/2012   V1.2   damb: added calex12 from EW
13
#    19/09/2012   V1.3   thof: vendor import of recent calex version
14
#    15/09/2016   V1.4   thof: install shell scripts and awk scripts
thomas.forbriger's avatar
thomas.forbriger committed
15
16
17
# 
# ============================================================================
#
18
# programs will be installed in $LOCBINDIR
19
# shell scripts will be installed in $LOCSCRIPTDIR
thomas.forbriger's avatar
thomas.forbriger committed
20

21
22
PROGRAMS=seife/seife calex/calex calex/calex10 calex/trical calex/qcalex \
	   sleeman/bandnois sleeman/tri2db sleeman/tricrosp sleeman/twocrosp \
23
	   dispcal/dispcal tiltcal/tiltcal
24

25
26
27
28
SCRIPTS=winplot/winplot.sh \
	  sleeman/tricrosp.sh \
	  calex/calexiterextract.awk \
	  calex/calexoutextract.awk \
29
	  calex/calex.sh \
30
31
32
	  sleeman/tridb2table.awk \
	  sleeman/bandnois2table.awk \
	  sleeman/tricrosp2table.awk
33
34
35
36
37
38
39
40

#----------------------------------------------------------------------
# check mandatory environment variable settings
# ---------------------------------------------

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

41
$(call CHECKVARS,LOCBINDIR LOCSCRIPTDIR)
42

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# ----------------------------------------------------------------------
#
.PHONY: all
all: install

.PHONY: install
install: $(addprefix $(LOCBINDIR)/,$(PROGRAMS)) \
         $(addprefix $(LOCSCRIPTDIR)/,$(SCRIPTS))

$(LOCBINDIR)/%: %
	mkdir -pv $(LOCBINDIR)
	/bin/mv -fv $< $(LOCBINDIR)

$(LOCSCRIPTDIR)/%: %
	mkdir -pv $(LOCSCRIPTDIR)
	/bin/cp -fv $< $(LOCSCRIPTDIR)

# ----------------------------------------------------------------------
#
62
63
64
65
66
67
68
69
FLAGS += $(MYFLAGS)
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS += $(FLAGS)
CXXFLAGS+=-Wall $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)

#----------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
70
71
72
73
74
75
76
77
78
79

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

.PHONY: edit
edit: flist; vim $<

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

#----------------------------------------------------------------------
83
84
# single source file programs
# ---------------------------
85

86
dispcal/dispcal tiltcal/tiltcal \
87
  sleeman/bandnois sleeman/tri2db sleeman/tricrosp sleeman/twocrosp \
88
  seife/makeseifehelp calex/makecalexhelp: %: %.o
thomas.forbriger's avatar
thomas.forbriger committed
89
	$(FC) -o $@ $<
90

91
92
93
# ----------------------------------------------------------------------
# seife
# -----
94
95
seife/seife: seife/seife.o seife/seifeinfo.o
	$(FC) -o $@ $^
96
	/bin/rm -fv seife/seifeinfo.*
97

98
99
100
101
102
103
104
seife/seifeinfo.f: seife/makeseifehelp seife/seife.f
	/bin/rm -fv $@
	cd seife; ./makeseifehelp

# ----------------------------------------------------------------------
# calex
# -----
105
106
107
calex/calex: calex/calex.o calex/calexinfo.o
	$(FC) -o $@ $^

108
109
110
111
112
113
114
calex/calex10: calex/calex10.o calex/calexinfo.o
	$(FC) -o $@ $^

calex/qcalex: calex/qcalex.o
	$(FC) -o $@ $^

calex/trical: calex/trical.o
115
116
	$(FC) -o $@ $^

117
118
calex/calexinfo.f: calex/makecalexhelp calex/calex.f \
  calex/calex.par calex/calex-pz.par
119
	/bin/rm -fv $@
120
	cd calex; ./makecalexhelp
121

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