Commit 9db5634f authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

migrated to new scheme; avoid incdep

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3399
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 9df425d5
......@@ -9,21 +9,20 @@
# REVISIONS and CHANGES
# 15/09/2008 V1.0 Thomas Forbriger
# use gfortran
# 17/11/2010 V1.1 migrated to new SVN scheme
#
# ============================================================================
#
# NOTICE: fallback solution (f2c is default) can be activated by the
# environment variable TF_FALLBACK
# This option will disappear somewhere in the future!
ALL=dig gresy gresynoise syg rhesyg
ALL=dig gresy gresynoise syg rhesyg wsyg
all: $(ALL)
# check mandatory environment variable settings
# ---------------------------------------------
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
F2CFLAGS=-f -u
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
PGPLOTF2CLIB=-l$(TF_f2c_PGPLOT) $(TF_LINK_PGPLOT)
PGPLOT77LIB=-l$(TF_g77_PGPLOT) $(TF_LINK_PGPLOT)
FORTRANLIB=$(TF_LINK_FORTRAN)
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
FLAGS += $(MYFLAGS)
CFLAGS += -O2 $(FLAGS)
......@@ -36,32 +35,10 @@ CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR) $(STATIC)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)
ifeq ($(TF_FALLBACK),yes)
LIBSTUFF=-lsff -L$(SERVERLIBDIR)
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
F2CFLAGS=-f -u
PGPLOTLIB=-lf2cpgplot -lX11 -L/usr/X11/lib
CC=gcc
CFLAGS=-I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
FCFLAGS=-g -Wall -ffixed-line-length-0 -fno-backslash
FCOPTS=-O2
.f.o:
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
@rm $(<:.f=.c)
%.o77: %.f; $(FC) -c -o $@ $<
else
%.f2c.o: %.f
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
@rm $(<:.f=.c)
%.o: %.f; $(FC) -c -o $@ $< $(FFLAGS)
endif
#----------------------------------------------------------------------
clean:
-/bin/rm *.o *.bak *.o77 *.odbg *.f2c.o
-/bin/rm *.o *.bak *.o77 *.odbg *.f2c.o *.d
echo $(patsubst %.f,%.c,$(wildcard *.f)) | \
xargs --no-run-if-empty rm -fv
......@@ -69,62 +46,16 @@ flist: $(wildcard *.f *.inc) Makefile
echo $^ | tr ' ' '\n' | sort > $@
edit: flist; vim $<
make.dep: *.f
incdep > make.dep
-include make.dep
ifeq ($(TF_FALLBACK),yes)
wsyg77: syg.o77
g77 -o $(LOCBINDIR)/$@ $< -g -lwrefsub77 -lrefread77 \
-ltf77 -L$(LOCLIBDIR)
gsyg77: syg.o77
g77 -o $(LOCBINDIR)/$@ $< -g -lgrgevsub77 -lflgevas77 -lrefread77 \
-ltf77 -L$(LOCLIBDIR)
syg77: syg.o77
g77 -o $(LOCBINDIR)/$@ $< -g -lgrrefsub77 -lrefread77 \
-ltf77 -L$(LOCLIBDIR)
dig: dig.o
gcc -o $(LOCBINDIR)/$@ $< \
-ltf $(F2CLIB) -L$(LOCLIBDIR)
wsyg: syg.o
gcc -o $(LOCBINDIR)/$@ $< -lwrefsub -lrefread \
-ltf $(F2CLIB) -L$(LOCLIBDIR)
# gevas version
gsyg: syg.o
gcc -o $(LOCBINDIR)/$@ $< -lgrgevsub -lflgevas -lwo -lrefread \
-ltf $(F2CLIB) -L$(LOCLIBDIR)
gsygdbg: syg.odbg
gcc -g -o $(LOCBINDIR)/$@ $< $(EXTRALIB) \
-lgrgevsubdbg -lflgevasdbg -lrefread \
-ltf $(F2CLIB) -L$(LOCLIBDIR)
#----------------------------------------------------------------------
syg: syg.o
gcc -o $(LOCBINDIR)/$@ $< -lgrrefsub -lrefread \
-ltf $(F2CLIB) -L$(LOCLIBDIR)
gresynoise: gresynoise.o nyquist_check.o
gcc -o $(LOCBINDIR)/$@ $^ -lgrrefsub -lrefread \
-ltf -lgsl -lgslcblas $(LIBSTUFF) $(F2CLIB) -L$(LOCLIBDIR)
%.d: %.f
echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.f,%.d,$(wildcard *.f))
gresy: gresy.o nyquist_check.o
gcc -o $(LOCBINDIR)/$@ $^ -lgrrefsub -lrefread \
-ltf $(LIBSTUFF) $(F2CLIB) -L$(LOCLIBDIR)
#----------------------------------------------------------------------
rhesyg: rhesyg.o
gcc -o $(LOCBINDIR)/rhesyg rhesyg.o -lgrrefsub -lrheology -lrefread \
-ltf $(F2CLIB) -L$(LOCLIBDIR)
%.o: %.f; $(FC) -c -o $@ $< $(FFLAGS)
# analytical section
afehsyg: syg.o
gcc -o $(LOCBINDIR)/$@ $< -lanafsexphyd -lrefread \
-ltf $(F2CLIB) -L$(LOCLIBDIR)
else
dig: dig.o
$(FC) -o $(LOCBINDIR)/$@ $< \
-ltf -L$(LOCLIBDIR)
......@@ -158,6 +89,5 @@ rhesyg: rhesyg.o
afehsyg: syg.o
$(FC) -o $(LOCBINDIR)/$@ $< -lanafsexphyd -lrefread \
-ltf -L$(LOCLIBDIR)
endif
# ----- END OF Makefile -----
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment