Makefile 1.76 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
8
9
10
11
12
# 
# Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt) 
# 
# sousou - sound source
# 
# REVISIONS and CHANGES 
#    10/05/2002   V1.0   Thomas Forbriger
# 
# ============================================================================
13
#
thomas.forbriger's avatar
thomas.forbriger committed
14

thomas.forbriger's avatar
thomas.forbriger committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
30
31
32
33
34
35
36
37
38
39

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
40
	-/bin/rm -vf flist *.o *.d *.doc
41

thomas.forbriger's avatar
thomas.forbriger committed
42
#----------------------------------------------------------------------
43
44
45
46

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
47
48
49
%.d: %.f
	echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.o,%.d,$(OBS))
50

thomas.forbriger's avatar
thomas.forbriger committed
51
52
53
54
55
56
57
58
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; } }' $^ > $@
59
60

sousou: $(OBS)
thomas.forbriger's avatar
thomas.forbriger committed
61
62
63
64
	$(FC) -o $(LOCBINDIR)/$@ $(OBS) \
        -ltf -lts $(LIBS) -lsff \
        $(TF_LINK_PGPLOT) $(LINLIB) \
        -L$(LOCLIBDIR) 
65

thomas.forbriger's avatar
thomas.forbriger committed
66
67

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