Commit 244068b3 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

g77 is now default

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: 2450
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent c4884bc0
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.9 2007-03-22 09:35:27 tforb Exp $
# $Id: Makefile,v 1.10 2007-11-27 17:34:54 tforb Exp $
#
# Copyright (c) 2003 by Thomas Forbriger (BFO Schiltach)
#
......@@ -25,14 +25,23 @@
# REVISIONS and CHANGES
# 23/12/2003 V1.0 Thomas Forbriger
# 22/03/2007 V1.1 create a distribution package
# 27/11/2007 V1.2 g77 compilation is now default
#
# ============================================================================
#
# NOTICE: fallback solution (f2c is default) can be activated by the
# environment variable TF_FALLBACK
# This option will disappear somewhere in the future!
LIBS=libsff.a libsff77.a
all: doc install
install: $(LIBS)
newlib $(LIBS)
ifneq ($(TF_FALLBACK),yes)
LIBS=libf2csff.a libsff.a
else
LIBS=libsff.a libsff77.a
endif
install: $(LIBS); /bin/mv -fv $^ $(LOCLIBDIR)
flist: Makefile $(wildcard *.f *c) README
echo $^ | tr ' ' '\n' | sort > $@
......@@ -40,41 +49,32 @@ flist: Makefile $(wildcard *.f *c) README
.PHONY: edit
edit: flist; vim $<
# check for cross compiler
ifdef CROSS_BASE
BINPREFIX=$(CROSS_BASE)/bin/dos-
else
BINPREFIX=
endif
FC=$(BINPREFIX)g77
CC=$(BINPREFIX)gcc
AR=$(BINPREFIX)ar
AS=$(BINPREFIX)as
RANLIB=$(BINPREFIX)ranlib
FC=g77
CC=gcc
AR=ar
AS=as
RANLIB=ranlib
F2CFLAGS=-f
FFLAGS=-ffixed-line-length-none
CFLAGS=-O2 -I${SERVERINCLUDEDIR}
FLAGS+=$(MYFLAGS)
FFLAGS=-ffixed-line-length-none $(FLAGS)
CFLAGS=-O2 -I${SERVERINCLUDEDIR} $(FLAGS)
F2CLIB=-lf2c -lm -L$(SERVERLIBDIR)
F2CFLAGS=-f
TESTS=tfullwrite tservice tskipdata teststuff tfullread
TESTS77=$(patsubst %,%77,$(TESTS))
tests: $(TESTS) $(TESTS77)
ifneq ($(TF_FALLBACK),yes)
TESTSX=$(patsubst %,%f2c,$(TESTS))
tests: $(TESTS) $(TESTSX)
else
TESTSX=$(patsubst %,%77,$(TESTS))
tests: $(TESTS) $(TESTSX)
endif
.PHONY: tests clean
clean:
-/bin/rm *.o *.bak *.o77 flist
-/bin/rm $(TESTS) $(TESTS22)
%.o: %.f
f2c -u -f $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I$(LOCINCLUDEDIR)
@rm $(<:.f=.c)
%.o77: %.f
$(FC) $(FFLAGS) $< -c -o $@
-/bin/rm *.o *.bak *.o77 *.f2c.o flist
-/bin/rm $(TESTS) $(TESTSX)
doc: stuff.f
awk 'BEGIN { flagsff=0; flaglib=0; } \
......@@ -88,6 +88,32 @@ doc: stuff.f
END { print "c ---- END OF sff.doc ----" > "sff.doc" ; \
print "c ---- END OF libsff.doc ----" > "libsff.doc" ;}' $<
ifneq ($(TF_FALLBACK),yes)
gse20.f2c.o: gse20.f
gse20.o: gse20.f
stuff.f2c.o: stuff.f
stuff.o: stuff.f
sunfortran.o: sunfortran.c
libf2csff.a: gse20.f2c.o stuff.f2c.o sunfortran.o
libsff.a: gse20.o stuff.o
%.f2c.o: %.f
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -o $@ -c \
-I${SERVERINCLUDEDIR} -I$(LOCINCLUDEDIR)
@rm $(<:.f=.c)
%.o: %.f
$(FC) $(FFLAGS) $< -c -o $@
%.a:
$(AR) rcv $@ $^
$(RANLIB) $@
$(TESTS): %: %.o; $(FC) $(CFLAGS) -o $@ $< -lsff -L$(LOCLIBDIR)
$(TESTSX): %f2c: %.f2c.o
$(CC) $(FCFLAGS) -o $@ $< -lf2csff $(F2CLIB) -L$(LOCLIBDIR)
else
gse20.o: gse20.f
gse20.o77: gse20.f
stuff.o: stuff.f
......@@ -97,12 +123,20 @@ sunfortran.o: sunfortran.c
libsff.a: gse20.o stuff.o sunfortran.o
libsff77.a: gse20.o77 stuff.o77
%.o: %.f
f2c -u -f $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I$(LOCINCLUDEDIR)
@rm $(<:.f=.c)
%.o77: %.f
$(FC) $(FFLAGS) $< -c -o $@
%.a:
$(AR) rcv $@ $^
$(RANLIB) $@
$(TESTS): %: %.o; $(CC) -o $@ $< -lsff $(F2CLIB)
$(TESTS77): %77: %.o77; $(FC) -o $@ $< -lsff77
$(TESTSX): %77: %.o77; $(FC) -o $@ $< -lsff77
endif
#======================================================================
# create package
......
Markdown is supported
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