Commit 91bf00a8 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: 3400
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 9db5634f
......@@ -9,14 +9,29 @@
# REVISIONS and CHANGES
# 27/03/2002 V1.0 Thomas Forbriger
# 09/02/2010 V1.1 move to gfortran
# 17/11/2010 V1.2 migrated to 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: gredi grenorm gretap greto magres
install: all
# check mandatory environment variable settings
# ---------------------------------------------
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
FLAGS += $(MYFLAGS)
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS += $(FLAGS)
CXXFLAGS+=-Wall $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
#----------------------------------------------------------------------
flist: Makefile $(wildcard *.f *.inc)
echo $^ | tr ' ' '\n' | sort > $@
......@@ -27,33 +42,17 @@ edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o
-/bin/rm -vf flist *.o *.d
F2CLIB=-lm -lf2c -L${SERVERLIBDIR} -L${LOCLIBDIR}
#F2CLIB=-lm -lgo32f2c -L$(LOCLIBDIR)
#CC=gcc-go32
#CC=gcc
LDFLAGS=-L$(LOCLIBDIR)
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS=-O2 -I${LOCINCLUDEDIR} -I${SERVERINCLUDEDIR}
#----------------------------------------------------------------------
# Fortran dependencies
# --------------------
%.d: %.f
echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.f,%.d,$(wildcard *.f))
include make.incdep
make.incdep: *.f
incdep > make.incdep
ifeq ($(TF_FALLBACK),yes)
%: %.f
f2c -u -f $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -o $@ -ltf -lsff $(F2CLIB) \
-L${LOCLIBDIR}
@rm $(<:.f=.c)
newprog $@
else
%: %.f
$(FC) $(FFLAGS) -o $@ $^ -ltf -lsff $(LDFLAGS)
/bin/mv -fv $@ $(LOCBINDIR)
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