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

read sff.h and provide appropriate typedefs

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: 3371
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 4863bca0
......@@ -33,6 +33,8 @@
# 18/09/2010 V1.3 start migration to SVN scheme
# discard f2c option (fallback) entirely
# check variables
# 14/11/2010 V1.4 replaced makefdoc.pl
# added C dependency files
#
# ============================================================================
#
......@@ -59,6 +61,23 @@ DOCS=libsffu.doc
LIBS=libsffu.a
install: install-include $(LIBS)
#----------------------------------------------------------------------
%.d: %.c
$(SHELL) -ec '$(CC) -M $(CPPFLAGS) $< \
| sed '\''s,\($(notdir $*)\)\.o[ :]*,$(dir $@)\1.o $@ : ,g'\'' \
> $@; \
[ -s $@ ] || rm -f $@'
-include $(patsubst %.c,%.d,$(patsubst %.o,%.c,$(LIBSFFUCOBS)))
install-include:
/bin/cp -fv $(wildcard *.h) $(LOCINCLUDEDIR)
#----------------------------------------------------------------------
flist: Makefile $(LIBSFFUCOBS:.o=.c) $(LIBSFFUFOBS:.o=.f) *.h
echo $^ | tr ' ' '\n' | sort > $@
......@@ -70,7 +89,7 @@ clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -fv flist *.o *.bak *.o77
install: install-include $(LIBS)
#----------------------------------------------------------------------
FLAGS += $(MYFLAGS)
F2CLIB=-lm -lf2c -L${SERVERLIBDIR}
......@@ -78,24 +97,27 @@ F2CFLAGS=-f -u
CFLAGS += -O2 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} $(FLAGS)
FFLAGS += -ff2c -ffixed-line-length-none -Wall $(FLAGS)
docs: $(DOCS)
%.o: %.c
$(CC) -O2 -o $@ -c $< -Wall $(CFLAGS) \
-I$(LOCINCLUDEDIR) -I$(SERVERINCLUDEDIR)
%.o: %.f
$(FC) -O2 -o $@ -c $< $(FFLAGS)
install-include:
/bin/cp -fv $(wildcard *.h) $(LOCINCLUDEDIR)
libsffu.a: $(LIBSFFUOBS)
%.a: ; ar rcv $@ $^ ; ranlib $@ ; /bin/mv -fv $@ $(LOCLIBDIR)
#======================================================================
# documentation
docs: $(DOCS)
libsffu.doc: $(LIBSFFUFOBS:.o=.f)
makefdoc.pl $@ $^
/usr/bin/awk 'BEGIN{ hot=0; } \
/^cS/ { hot=1; \
print FILENAME; \
print " c\n c -----------------------------------------\n c"; \
next; } \
/^cE/ { hot=0; } \
{ if (hot==1) { print " " $$0; } }' $^ > $@
#======================================================================
# create package
......
......@@ -41,15 +41,17 @@
* 06/12/07 some corrections to decalarations to satisfy my compiler
* 18/09/2010 compiler issues warning since there exits not true prototypes
* for libsff.a routines
*
* 14/11/2010 appropriate Fortran variable types are provided by libtime.h
* include sff.h
*/
/* libtime.h also provides Fortran variable types like integer, real, etc */
#include <libtime.h>
#include <sffutil.h>
#include <sff.h>
#include <stdlib.h>
#include <f2c.h>
#include <stdio.h>
#include <string.h>
#include <sffutil.h>
#include <libtime.h>
#include <tfmacros.h>
/*
......
......@@ -25,15 +25,29 @@
* 16/11/99 added float to int converter and sff_Tdata
* prototype for sff_WInfo was missing
* 11/10/00 reading f2c first is mandatory with new libtime version
* 14/11/10 appropriate Fortran variable types are provided by libtime.h
* provide prototypes for function in sffutilf.f
* provide typedef for Fortran type real
*
*/
#ifndef _TF_SFFUTIL_H
#define _TF_SFFUTIL_H
#include <f2c.h>
#define F2C_INCLUDE
/* libtime.h also provides Fortran variable types like integer, real, etc */
#include <libtime.h>
/* a typedef for real is not provided by libtime.h */
typedef float real;
/*======================================================================*/
/* prototypes for Fortran interface functions in sffutilf.f */
extern int sff_filewopen__(integer *lu, char *filename, integer *ierr, ftnlen
filename_len);
extern int sff_fileclose__(integer *lu, integer *ierr);
extern int sff_writeline__(integer *funit, char *text, ftnlen text_len);
/*======================================================================*/
/*
* define macros
......
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