Makefile 2.46 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) 2002 by Thomas Forbriger (IMG Frankfurt) 
# 
# sousou - sound source
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
27
28
# 
# REVISIONS and CHANGES 
#    10/05/2002   V1.0   Thomas Forbriger
# 
# ============================================================================
29
#
thomas.forbriger's avatar
thomas.forbriger committed
30

thomas.forbriger's avatar
thomas.forbriger committed
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
all: sousou

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

$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
$(call CHECKVARS,TF_BROWSER TF_WWWBASEDIR)

LINLIB=-llapack -lblas
CC=gcc
CFLAGS=-O2 -I${LOCINCLUDEDIR} 
LIBS=-lsffu -ltime
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)

#----------------------------------------------------------------------
thomas.forbriger's avatar
thomas.forbriger committed
46
47
48
49
50
51
52
53
54
55

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

.PHONY: edit
edit: flist; vim $<

.PHONY: clean
clean: ; 
	-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
thomas.forbriger's avatar
thomas.forbriger committed
56
	-/bin/rm -vf flist *.o *.d *.doc
57

thomas.forbriger's avatar
thomas.forbriger committed
58
#----------------------------------------------------------------------
59
60
61
62

OBS=sousou.o sousou_readdata.o sousou_skipdata.o sousou_checks.o \
   sousou_prepare.o sousou_writedata.o sousou_analysis.o sousou_writeslow.o

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

thomas.forbriger's avatar
thomas.forbriger committed
67
68
69
70
71
72
73
74
sousou.doc: $(patsubst %.o,%.f,$(OBS))
	/usr/bin/awk 'BEGIN{ hot=0; } \
        /^cS/ { hot=1; \
	    print FILENAME; \
          print "  c\n  c"; \
          next; } \
        /^cE/ { hot=0; } \
        { if (hot==1) { print "  " $$0; } }' $^ > $@
75
76

sousou: $(OBS)
thomas.forbriger's avatar
thomas.forbriger committed
77
78
79
80
	$(FC) -o $(LOCBINDIR)/$@ $(OBS) \
        -ltf -lts $(LIBS) -lsff \
        $(TF_LINK_PGPLOT) $(LINLIB) \
        -L$(LOCLIBDIR) 
81

thomas.forbriger's avatar
thomas.forbriger committed
82
83

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