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

g77 is 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: 2449
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent fa62d0a2
# this is <Makefile>
# ----------------------------------------------------------------------------
# $Id: Makefile,v 1.14 2007-06-05 09:13:13 tforb Exp $
# $Id: Makefile,v 1.15 2007-11-27 17:19:29 tforb Exp $
#
# Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
#
......@@ -28,46 +28,40 @@
#
# REVISIONS and CHANGES
# 05/06/2007 V1.0 Thomas Forbriger
# 27/11/2007 V1.1 g77 compilation is the default now
#
# ============================================================================
#
# NOTICE: fallback solution (f2c is default) can be activated by the
# environment variable TF_FALLBACK
# This option will disappear somewhere in the future!
all: install libtf.doc
ifeq ($(TF_FALLBACK),yes)
install: install-include libtf.a libtf77.a
else
install: install-include libtf.a libf2ctf.a
endif
.PHONY: clean edit
clean:
-/bin/rm -fv *.o *.bak *.o77 flist *.xxx
-/bin/rm -fv *.o *.bak *.o77 flist *.xxx *.f2c.o *.doc *.a
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist
-/bin/rm -vf flist testlibtf77 testlibf2ctf testlibtf
edit: flist ; vim flist
flist: *.c *.h *.f Makefile ; echo $^ | tr ' ' '\n' | sort > $@
#
# note for AIX-system:
# FC=xlf
# FCFLAGS=-qfixed=300
#
# 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
FLAGS += $(MYFLAGS)
F2CLIB=-lm -lf2c -L${SERVERLIBDIR}
F2CFLAGS=-f -u
FCFLAGS=-Wall -ffixed-line-length-0 -fno-backslash
CFLAGS=-O3 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
FCFLAGS=-Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS=-O3 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} $(FLAGS)
AR=ar
RANLIB=ranlib
FC=g77
SUBS=tf_cmdline.o tf_costap.o tf_doubletoint.o tf_fork.o tf_inttodouble.o\
tf_inttoreal.o tf_listselect.o tf_realtoint.o tf_rectint.o\
......@@ -93,10 +87,16 @@ docs: libtf.doc
libtf.doc: $(DOCSRC)
makefdoc.pl $@ $^
# echo '#### DOCUMENTATION for files in' `pwd` > libtf.doc
# echo $(DOCSRC) | tr ' ' '\012' >> libtf.doc
# extractdoc.tcl $(DOCSRC) >> libtf.doc
install-include: libtf.h
/bin/bash -c 'for d in $^; \
do \
rm $(LOCINCLUDEDIR)/$$d; \
ln -s `pwd`/$$d $(LOCINCLUDEDIR)/$$d; \
ls -l $(LOCINCLUDEDIR)/$$d; \
done'
ifeq ($(TF_FALLBACK),yes)
# fallback solution: f2c is default
.f.o:
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c
......@@ -111,44 +111,79 @@ libtf.doc: $(DOCSRC)
.c.o:
$(CC) $(CFLAGS) $< -c -I${SERVERINCLUDEDIR}
install-include: libtf.h
/bin/bash -c 'for d in $^; \
do \
rm $(LOCINCLUDEDIR)/$$d; \
ln -s `pwd`/$$d $(LOCINCLUDEDIR)/$$d; \
ls -l $(LOCINCLUDEDIR)/$$d; \
done'
libtf77.a: $(SUBS:.o=.o77)
$(AR) rcv $@ $^
$(RANLIB) $@
newlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
libtf.a: $(SUBS)
$(AR) rcv libtf.a $(SUBS)
$(RANLIB) libtf.a
newlib libtf.a
/bin/mv -fv $@ $(LOCLIBDIR)
testlibtf: testlibtf.o libtf.a
$(CC) -o $@ $< -ltf -lf2c -lm -lgsl -lgslcblas \
$(CC) -o $@ $< -ltf -lf2c -lm -lgsl -lgslcblas $(CFLAGS) \
-L$(LOCLIBDIR) -L$(SERVERLIBDIR)
testlibtf77: testlibtf.o77 libtf77.a
$(FC) -o $@ $< -ltf77 -lm -lgsl -lgslcblas \
$(FC) -o $@ $< -ltf77 -lm -lgsl -lgslcblas $(FCFLAGS) \
-L$(LOCLIBDIR) -L$(SERVERLIBDIR)
else
# new priority: g77 is default
%.f2c.o: %.f
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c -o $@
@rm $(<:.f=.c)
%.f2c.o: %.c
$(CC) -O2 -o $@ -c $< -Wall $(CFLAGS) \
-I$(LOCINCLUDEDIR) -I$(SERVERINCLUDEDIR)
%.o: %.c
$(CC) -O2 -o $@ -c $< -Wall $(CFLAGS) \
-I$(LOCINCLUDEDIR) -I$(SERVERINCLUDEDIR)
%.o: %.f
$(FC) -O2 -o $@ -c $< $(FCFLAGS)
libf2ctf.a: $(patsubst %.o,%.f2c.o,$(SUBS))
$(AR) rcv $@ $^
$(RANLIB) $@
/bin/mv -fv $@ $(LOCLIBDIR)
libtf.a: $(SUBS)
$(AR) rcv libtf.a $(SUBS)
$(RANLIB) libtf.a
/bin/mv -fv $@ $(LOCLIBDIR)
testlibtf: testlibtf.o libtf.a
$(FC) -o $@ $< -ltf -lm -lgsl -lgslcblas $(FCFLAGS) \
-L$(LOCLIBDIR) -L$(SERVERLIBDIR)
testlibf2ctf: testlibtf.f2c.o libf2ctf.a
$(CC) -o $@ $< -lf2ctf -lf2c -lm -lgsl -lgslcblas $(CFLAGS) \
-L$(LOCLIBDIR) -L$(SERVERLIBDIR)
endif
#======================================================================
# testcode
%.sort.xxx: %.xxx; sort -n $< > $@
%.plot.xxx: %.xxx
echo 'plot "$<" ' > $@
echo 'pause -1 "press return to continue"' >> $@
%.plot: %.plot.xxx; gnuplot $<
rngtest:
testlibtf -rng -f -n 9900
ifeq ($(TF_FALLBACK),yes)
# fallback solution: f2c is default
rngtest: testlibtf testlibtf77
./testlibtf -rng -f -n 9900
$(MAKE) test_gaussian.sort.plot test_uniform.sort.plot
./testlibtf77 -rng -f -n 9900
$(MAKE) test_gaussian.sort.plot test_uniform.sort.plot
testlibtf77 -rng -f -n 9900
else
# new priority: g77 is default
rngtest: testlibtf testlibf2ctf
./testlibtf -rng -f -n 9900
$(MAKE) test_gaussian.sort.plot test_uniform.sort.plot
./testlibf2ctf -rng -f -n 9900
$(MAKE) test_gaussian.sort.plot test_uniform.sort.plot
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