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

libtime is migrated to new scheme

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.
package creation is not yet included


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libenv201008
SVN Revision: 3144
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent a3fd4247
......@@ -42,13 +42,49 @@
# 17/12/2007 V1.9 all components are tested with their test programs
# against results on system prior to migration
# moved to gfortran
# 18/09/2010 V1.10 start migration to new SVN repository scheme
# fallback solution is removed
# f2c version is discarded
# doxygen docu uses new scheme
# delegate package creation
#
# ============================================================================
#
# NOTICE: fallback solution (f2c is default) can be activated by the
# environment variable TF_FALLBACK
# This option will disappear somewhere in the future!
# targets
all: install doc example exectests
install: install-include libraries
doc: doxydoc libtime.doc
example: tests/example++; tests/example++
exectests: tests
libraries: libtime_trad.a libtime.a libctime.a libtime++.a
# ============================================================================
# a variable definition to check variable settings
# ------------------------------------------------
# if you want to check whether variable TF_PUBLICATIONPATH is non-empty,
# insert line
#
## $(call CHECKVAR,TF_PUBLICATIONPATH)
#
# in your Makefile
#
# if you want to check whether variable AVAR, BVAR, and CVAR are non-empty,
# insert line
#
## $(call CHECKVARS,AVAR BVAR CVAR)
#
# in your Makefile
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
$(call CHECKVARS,WWWBASEDIR TF_BROWSER)
#----------------------------------------------------------------------
# variables
#
AR=ar
AS=as
RANLIB=ranlib
......@@ -61,28 +97,12 @@ FFLAGS += -Wall -ff2c $(FLAGS)
CFLAGS += -O2 $(FLAGS)
CPPFLAGS += -I. -I${LOCINCLUDEDIR} $(FLAGS)
LIBTIME=-ltime -L$(LOCLIBDIR)
ifeq ($(TF_FALLBACK),yes)
LIBTIME77=-ltime77 -L$(LOCLIBDIR)
else
LIBF2CTIME=-lf2ctime -L$(LOCLIBDIR)
endif
LIBCTIME=-lctime -L$(LOCLIBDIR)
LIBCXXTIME=-ltime++ -L$(LOCLIBDIR)
LIBTIMETRAD=-ltime_trad -L$(LOCLIBDIR)
# external homemade library (needed by testlibtime)
LIBSFFU=-lsffu -L$(LOCLIBDIR)
ifeq ($(TF_FALLBACK),yes)
LIBSFFU77=-lsffu77 -L$(LOCLIBDIR)
else
LIBF2CSFFU=-lf2csffu -L$(LOCLIBDIR)
endif
all: install doc example exectests
install: install-include libraries
doc: doxyview libtime.doc
example: tests/example++; tests/example++
exectests: tests
#======================================================================
#
......@@ -97,11 +117,11 @@ KERNEL=kernel/time_add.f kernel/time_clear.f kernel/time_compare.f \
kernel/time_norm.f kernel/time_setdoy.f kernel/time_sub.f
# language specific code
# FORTRAN
# Fortran version
FCODE= kernel/time_sprint.f kernel/time_read.f kernel/time_info.f
FHANDLER= kernel/time_util_fatal.f kernel/time_util_warning.f
# C
# C: wrapper functions call underlying Fortran functions
CWRAPPER=Cwrapper/ctime_add.c Cwrapper/ctime_clear.c \
Cwrapper/ctime_compare.c Cwrapper/ctime_copy.c Cwrapper/ctime_div.c \
Cwrapper/ctime_finish.c Cwrapper/ctime_fullyear.c \
......@@ -111,8 +131,12 @@ CWRAPPER=Cwrapper/ctime_add.c Cwrapper/ctime_clear.c \
Cwrapper/ctime_sub.c
# language specific code
# C version
CCODE= Cwrapper/ctime_sprint.c Cwrapper/ctime_read.c
CHANDLER=Cwrapper/ctime_util_fatal.c Cwrapper/ctime_util_warning.c
# language specific code
# C++ version
CXXHANDLER=C++wrapper/cxxtime_util_fatal.cc C++wrapper/cxxtime_util_warning.cc
# C++ functions
......@@ -126,19 +150,28 @@ CXXCODE= C++wrapper/base_constr.cc \
C++wrapper/hierarchicaltimestring.cc \
C++wrapper/cxxtime_util_warning.cc
#----------------------------------------------------------------------
# test code
CTESTS= tests/ctlibtime.c tests/timer.c tests/timeutil.c
FTESTS= tests/testlibtime.f tests/ttime_read.f
CXXTESTS=tests/testtime++.cc tests/example++.cc
#----------------------------------------------------------------------
# header files
HEADERS=libtime.h libtime++.h timeutil.h
#----------------------------------------------------------------------
# assembled file collections
ALLCODE=$(KERNEL) $(FCODE) $(FHANDLER) $(CWRAPPER) $(CCODE) $(CHANDLER) \
$(CXXCODE) $(CTESTS) $(FTESTS) $(CXXTESTS) timeutil.c \
$(HEADERS)
README=README README.changes README.files README.unsplit
ALLFILES=$(KERNEL) $(FCODE) $(CWRAPPER) $(CCODE) Makefile $(README) \
timeutil.c timeutil.h libtime.h $(FHANDLER) $(CHANDLER) \
$(CTESTS) $(FTESTS) libtime++.h $(CXXTESTS) $(CXXCODE) doxydoc.cfg
#======================================================================
#
# dependencies
......@@ -159,26 +192,16 @@ README=README README.changes README.files README.unsplit
#
# rules
# -----
$(call CHECKVARS,LOCLIBDIR LOCBINDIR LOCINCLUDEDIR)
ifeq ($(TF_FALLBACK),yes)
# how to create object files thorugh f2c
%.o: %.f
f2c $(F2CFLAGS) -d $(@D) $<
$(CC) $(CFLAGS) $(CPPFLAGS) $(FLAGS) -o $@ $(<:.f=.c) -c
@rm $(<:.f=.c)
# how to create pure f77 object files
%.o77: %.f; $(FC) $(FFLAGS) $(FLAGS) -c -o $@ $^
else
# how to create object files thorugh f2c
%.f2c.o: %.f
f2c $(F2CFLAGS) -d $(@D) $<
$(CC) $(CFLAGS) $(CPPFLAGS) $(FLAGS) -o $@ $(<:.f=.c) -c
@rm $(<:.f=.c)
# how to create pure f77 object files
# how to create pure Fortran object files
%.o: %.f; $(FC) $(FFLAGS) $(FLAGS) -c -o $@ $^
endif
# C++ stuff
%.o: %.cc; $(CXX) $(FLAGS) -o $@ $< -c -I$(LOCINCLUDEDIR)
......@@ -197,45 +220,35 @@ clean:
xargs --no-run-if-empty /bin/rm -v
-/bin/rm -v flist libtime.doc *.tmp *.htmp *.out
flist: $(KERNEL) $(FCODE) $(CWRAPPER) $(CCODE) Makefile $(README) \
timeutil.c timeutil.h libtime.h $(FHANDLER) $(CHANDLER) \
$(CTESTS) $(FTESTS) libtime++.h $(CXXTESTS) $(CXXCODE) doxyfull.cfg
flist: $(ALLFILES)
echo $^ | tr ' ' '\n' | sort > $@
edit: flist; vim $<
install-include: $(HEADERS)
/bin/ln -sfv $(addprefix $(shell pwd)/,$^) $(LOCINCLUDEDIR)
#======================================================================
# install headers
$(call CHECKVAR,LOCINCLUDEDIR)
$(LOCINCLUDEDIR)/%.h: %.h
mkdir -vp $(dir $@)
-rm -fv $@
/bin/cp -vpd $< $@
# install header files
install-include: $(addprefix $(LOCINCLUDEDIR)/,$(HEADERS))
echo $^ | tr ' ' '\n'
touch $@
#======================================================================
#
# library dependency definitions
# ------------------------------
ifeq ($(TF_FALLBACK),yes)
libraries: libtime_trad.a libtime.a libtime77.a libctime.a libtime++.a
# traditional libtime
libtime_trad.a: $(patsubst %.f,%.o,$(KERNEL) $(FCODE) $(FHANDLER)) \
$(patsubst %.c,%.o,$(CWRAPPER) $(CCODE)) timeutil.o
# pure FORTRAN libtime (f2c version)
libtime.a: $(patsubst %.f,%.o,$(KERNEL) $(FCODE) $(FHANDLER))
# pure FORTRAN libtime (f77 version)
libtime77.a: $(patsubst %.f,%.o77,$(KERNEL) $(FCODE) $(FHANDLER))
else
libraries: libtime_trad.a libtime.a libf2ctime.a libctime.a libtime++.a
# pure FORTRAN libtime (g77 version)
libtime.a: $(patsubst %.f,%.o,$(KERNEL) $(FCODE) $(FHANDLER))
# pure FORTRAN libtime (f2c version)
libf2ctime.a: $(patsubst %.f,%.f2c.o,$(KERNEL) $(FCODE) $(FHANDLER))
# traditional libtime
libtime_trad.a: $(patsubst %.f,%.o,$(KERNEL) $(FCODE) $(FHANDLER)) \
$(patsubst %.c,%.o,$(CWRAPPER) $(CCODE)) timeutil.o
endif
# pure C libtime
libctime.a: $(patsubst %.f,%.o,$(KERNEL)) \
......@@ -251,31 +264,19 @@ libtime++.a: $(patsubst %.f,%.o,$(KERNEL)) \
# test code
# ---------
ifeq ($(TF_FALLBACK),yes)
$(patsubst %.f,%,$(FTESTS)): %: %.o libtime.a
$(CC) -o $@ $< $(LIBTIME) $(LIBSFFU) $(LIBF2C)
$(patsubst %.f,%77,$(FTESTS)): %77: %.o77 libtime.a
$(FC) -o $@ $< $(LIBTIME77) $(LIBSFFU77)
else
$(patsubst %.f,%f2c,$(FTESTS)): %: %.f2c.o libf2ctime.a
$(CC) -o $@ $< $(LIBTIME) $(LIBF2CSFFU) $(LIBF2C)
$(patsubst %.f,%,$(FTESTS)): %: %.o libtime.a
$(FC) -o $@ $< $(LIBTIME) $(LIBSFFU)
endif
tests/timer: %: %.o; $(CC) -o $@ $<
tests/ctlibtime: %: %.o; $(CC) -o $@ $< $(LIBCTIME)
tests/timeutil: %: %.o; $(CC) -o $@ $< -static $(LIBTIMETRAD) $(LIBF2C)
tests/timeutil: %: %.o; $(CC) -o $@ $< -static $(LIBTIMETRAD)
tests/example++ tests/testtime++: %: %.o libtime++.a
$(CXX) -o $@ $< $(LIBCXXTIME)
TESTS=$(patsubst %.c,%,$(CTESTS)) $(patsubst %.f,%,$(FTESTS)) \
$(patsubst %.f,%77,$(FTESTS)) $(patsubst %.cc,%,$(CXXTESTS))
$(patsubst %.cc,%,$(CXXTESTS))
tests: $(patsubst %.c,%,$(CTESTS)) $(patsubst %.f,%,$(FTESTS)) \
$(patsubst %.f,%77,$(FTESTS)) $(patsubst %.cc,%,$(CXXTESTS))
tests: $(TESTS)
for d in $^; do /bin/echo -e "\n\nGO FOR $$d?"; read a; $$d; done
%.run: tests/%; $<; /bin/rm -fv $<
......@@ -287,13 +288,10 @@ DIFFREFERENCE=/home/thof/tmp/libtimeout/
testresults: $(addsuffix .out,$(patsubst tests/%,%,$(TESTS)))
testsexe:
for d in $(TESTS); do /bin/echo -e "\n\nGO FOR $$d?"; read a; $$d; done
#======================================================================
#
# DOC
# ---
# ASCII documentation (Fortran and C code)
# ----------------------------------------
kernel.tmp: $(KERNEL)
fortran.tmp: $(FCODE)
......@@ -332,10 +330,53 @@ libtime.doc: README kernel.tmp fortran.tmp libtime.htmp timeutil.htmp \
cat timeutil.htmp >> $@
echo -e ' \n \nCVS REVISIONS' \
'\n=============\n' >> $@
ident `find . -type f` | egrep '^ +\$$Id.+\$$' | cut -c 5- \
ident $(ALLFILES) | egrep '^ +\$$Id.+\$$' | cut -c 5- \
| sort | uniq | awk '{printf "%5s %25s %6s %12s %10s %8s %s\n", \
$$1, $$2, $$3, $$4, $$5, $$6, $$7;}' >> $@
#======================================================================
# documentation part
# ------------------
#
# targets commonly used:
# ----------------------
#
# make doxyclean removes all documentation
# make doxydoc creates doxygen documentation in the DOXYWWWPATH
# make doxyview creates doxygen documentation and launches netscape to
# browse in the documentation
# make doxyconf edit the doxygen configuration file
#
# If you launch "make doxydoc" the documentation will be written to
# DOXYWWWPATH (see below). This is meant to export the documentation through
# your homepage. The doxyfull directory is just a symbolic link to this
# directory.
#
$(call CHECKVARS,WWWBASEDIR TF_BROWSER)
DOXYWWWPATH=$(WWWBASEDIR)/libtimexx
.PHONY: doxyclean doxyview doxydoc doxyconf
doxyclean: ;/bin/rm -rfv $(DOXYWWWPATH)
DOXYSRC=$(CXXCODE) $(CXXTESTS) $(CXXHANDLER) $(HEADERS)
# create doxygen intermediate configuration
doxydoc.xxx: doxydoc.cfg
sed 's,<OUTPUTDIRECTORY>,$(DOXYWWWPATH),g;s,<STRIPFROMPATH>,$(PWD),g' \
$< > $@
$(DOXYWWWPATH)/html/index.html: doxydoc.xxx $(DOXYSRC)
mkdir -vp $(DOXYWWWPATH)
doxygen $<
doxydoc: $(DOXYWWWPATH)/html/index.html
doxyview: $(DOXYWWWPATH)/html/index.html
$(TF_BROWSER) file:$< &
#======================================================================
# WWW distribution
WWWPATH=$(HOME)/public_html/download/software/libtime
......@@ -351,19 +392,16 @@ wwwdistrib: libtime.doc $(README)
/usr/bin/yes end | ( $(MAKE) testsexe 2>&1 ) > wwwpath/tests.out
( tests/example++ 2>&1 ) > wwwpath/example.out
wwwclean:
/bin/rm -rfv wwwpath/* wwwpath
WWWDOXYPATH=$(WWWBASEDIR)/libtimexx
doc: ; /bin/mkdir -pv $(WWWDOXYPATH); /bin/ln -sfv $(WWWDOXYPATH) doc
doc/html/index.html: doc doxyfull.cfg $(ALLCODE); doxygen $(word 2,$^)
doxydoc doxyfull: doc/html/index.html
doxyclean: ; /bin/rm -rfv doc/* doc
doxyview: doc/html/index.html;
$(TF_BROWSER) file://$(shell pwd)/$< &
#======================================================================
# create package
# --------------
# is delegated to Makefile.packages
# which still has to be coded
PACKAGE=libtime
PUBLICATIONPATH=$(HOME)/public_html/download/software
ifdef TF_MAKEPKG
include $(TF_MAKEPKG)
endif
#
# distribution package
# --------------------
......@@ -371,32 +409,6 @@ libtime.tar.gz: $(ALLCODE) Makefile libtime.doc \
README README.changes README.files README.unsplit
tar cvfz $@ $^
VERSIONCODE=$(shell date +'%Y%m%d')
PACKAGE=libtime$(VERSIONCODE)
PUBLICATIONPATH=$(HOME)/public_html/download/software
TMPPATH=$(HOME)/tmp/$(PACKAGE)
distributiondir: README README.changes README.files README.unsplit
package:
/bin/rm -rfv $(TMPPATH); mkdir -pv $(TMPPATH)
cd $(TMPPATH)/..; cvs export -r HEAD -d $(PACKAGE) thof/src/libs/libtime
cd $(TMPPATH)/..; cvs export -r HEAD -d $(PACKAGE) thof/src/LICENSE.GPL
cd $(TMPPATH)/..; cvs export -r HEAD \
-d $(PACKAGE) thof/src/libs/tfmacros.h
cd $(TMPPATH)/..; cvs export -r HEAD \
-d $(PACKAGE) thof/src/README.compile
cd $(TMPPATH)/..; cvs export -r HEAD \
-d $(PACKAGE) thof/src/README.1st
/bin/bash -c 'cd $(TMPPATH); \
export LOCINCLUDEDIR=include; export LOCLIBDIR=binlib; \
export WWWBASEDIR=doxydoc; export LOCBINDIR=bin; \
mkdir -vp include binlib bin doxydoc; \
make all; make clean; /bin/rm -rfv include binlib bin'
cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE)
gzip --force -9 $(PUBLICATIONPATH)/$(PACKAGE).tar
cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE)
bzip2 -f $(PUBLICATIONPATH)/$(PACKAGE).tar
$(MAKE) wwwdistrib
# ----- END OF Makefile -----
......@@ -9,6 +9,8 @@
# For lists items can also be appended using:
# TAG += value [value, ...]
# Values that contain spaces should be placed between quotes (" ")
#
# $Id$
#---------------------------------------------------------------------------
# General configuration options
......@@ -30,7 +32,7 @@ PROJECT_NUMBER =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doc
OUTPUT_DIRECTORY = <OUTPUTDIRECTORY>
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
# documentation generated by doxygen is written. Doxygen will use this
......@@ -136,14 +138,14 @@ INLINE_INHERITED_MEMB = NO
# path before files name in the file list and in the header files. If set
# to NO the shortest path that makes the file name unique will be used.
FULL_PATH_NAMES = NO
FULL_PATH_NAMES = YES
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
# can be used to strip a user-defined part of the path. Stripping is
# only done if one of the specified strings matches the left-hand part of
# the path. It is allowed to use relative paths in the argument list.
STRIP_FROM_PATH =
STRIP_FROM_PATH = <STRIPFROMPATH>
# The INTERNAL_DOCS tag determines if documentation
# that is typed after a \internal command is included. If the tag is set
......@@ -192,7 +194,7 @@ JAVADOC_AUTOBRIEF = YES
# The new default is to treat a multi-line C++ comment block as a detailed
# description. Set this tag to YES if you prefer the old behaviour instead.
MULTILINE_CPP_IS_BRIEF = NO
MULTILINE_CPP_IS_BRIEF = YES
# If the DETAILS_AT_TOP tag is set to YES then Doxygen
# will output the detailed description near the top, like JavaDoc.
......@@ -359,9 +361,9 @@ INPUT = ./
# *.h++ *.idl *.odl *.cs
FILE_PATTERNS = README \
README.changelog \
*.h \
*.cc \
*.c
*.cc
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
......@@ -373,7 +375,7 @@ RECURSIVE = YES
# excluded from the INPUT source files. This way you can easily exclude a
# subdirectory from a directory tree whose root is specified with the INPUT tag.
EXCLUDE = wwwpath doc
EXCLUDE =
# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories
# that are symbolic links (a Unix filesystem feature) are excluded from the input.
......@@ -390,7 +392,7 @@ EXCLUDE_PATTERNS =
# directories that contain example code fragments that are included (see
# the \include command).
EXAMPLE_PATH =
EXAMPLE_PATH = tests
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
......@@ -866,7 +868,7 @@ INCLUDE_FILE_PATTERNS =
# or name=definition (no spaces). If the definition and the = are
# omitted =1 is assumed.
PREDEFINED =
PREDEFINED = DOXYGEN_MUST_SKIP_THIS
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
# this tag can be used to specify a list of macro names that should be expanded.
......
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