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

distinguish between library creation and library installation

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.
provide target reinstall for all libraries


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 3702
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent aaf8726e
......@@ -47,6 +47,7 @@
# 17/08/2010 V1.6 prepare for new environment settings
# 18/09/2010 V1.7 TF_WWWBASEDIR and TF_REMCMMNT must be used
# 10/11/2010 V1.8 removed fragments for binarry
# 17/01/2011 V1.9 distinguish library creation and installation
#
# ============================================================================
#
......@@ -66,8 +67,16 @@
#
# You will find the installed library header files in $(LOCINCLUDEDIR)/aff
all: install doxydoc
install: install-include libaff.a libaff.so
.PHONY: all
all: install doc
.PHONY: doc
doc: doxydoc
LIBRARIES=libaff.a libaff.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
# ============================================================================
# a variable definition to check variable settings
......@@ -158,7 +167,7 @@ clean: ;
-find . -name \*.o | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.h.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o install-include libcontxx.a *.xxx junk*
-/bin/rm -vf flist *.o install-include libcontxx.a *.xxx junk* *.a *.so
cd tests; $(MAKE) clean
#======================================================================
......@@ -173,11 +182,9 @@ LIBOBS=$(patsubst %.cc,%.o,$(SRC))
libaff.a: $(INSTHEADER) $(LIBOBS)
ar rcv $@ $(LIBOBS)
ranlib $@
/bin/mv -vf $@ $(LIBINSTALLPATH)
libaff.so: $(INSTHEADER) $(LIBOBS)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBS)
/bin/mv -fv $@ $(LOCLIBDIR)
#======================================================================
# dependencies
......
......@@ -11,13 +11,37 @@
#
# REVISIONS and CHANGES
# 04/07/2002 V1.0 Thomas Forbriger
# 17/01/2011 V1.1 distinguish library creation and installation
#
# ============================================================================
#
ALL=libanafsexphyd.a
LIBRARIES=libanafsexphyd.a
all: $(ALL)
.PHONY: all
all: install
.PHONY: doc
doc:
.PHONY: install
install: $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) install
# 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)
#----------------------------------------------------------------------
flist: Makefile $(wildcard *.f *.inc)
echo $^ | tr ' ' '\n' | sort > $@
......@@ -28,33 +52,31 @@ 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 *.a
#----------------------------------------------------------------------
F2C = f2c
FC=g77
AR = ar
F2CFLAGS = -f -u
CFLAGS = -O3
FCFLAGS=-ffixed-line-length-0
FCOPTS=-O2
FLAGS += $(MYFLAGS) -fPIC
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS += $(FLAGS)
CXXFLAGS+=-Wall $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
%.o: %.f
$(F2C) $(F2CFLAGS) -d$(dir $<) $<
$(CC) -c $(CFLAGS) $(dir $<)$*.c -o $@
-rm -f $(dir $<)$*.c
#======================================================================
# Fortran dependencies
# --------------------
%.d: %.f
echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.f,%.d,$(wildcard *.f))
%.o: %.c
$(CC) -c $(CFLAGS) $< -o $@
%.o77: %.f
%.o: %.f
$(FC) $(FCFLAGS) $(FCOPTS) -o $@ -c $<
#----------------------------------------------------------------------
# libraries
libanafsexphyd.a: interface.o fsexphyd.o
$(ALL): %.a: ; ar rcv $@ $^; ranlib $@; newlib $@
$(LIBRARIES): %.a: ; ar rcv $@ $^; ranlib $@
# ----- END OF Makefile -----
......@@ -36,12 +36,23 @@
# - new doxygen definitions
# - package creation not yet implemented
# 14/10/2010 V1.5 included tfascii reading
# 17/01/2011 V1.6 distinguish library creation and installation
#
# ============================================================================
#
.PHONY: all
all: install doxydoc
install: install-include libdatrwxx.a libdatrwxx.so
.PHONY: doc
doc: doxydoc
LIBRARIES=libdatrwxx.a libdatrwxx.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
# ============================================================================
#
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
......@@ -119,7 +130,7 @@ clean: ;
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.hd | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist
-/bin/rm -vf flist *.a *.so
#======================================================================
# pattern rules
......@@ -140,11 +151,9 @@ clean: ;
libdatrwxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
libdatrwxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^
/bin/mv -fv $@ $(LOCLIBDIR)
#----------------------------------------------------------------------
# comment stripping
......
......@@ -31,12 +31,30 @@
# discard f2c option (fallback)
# check variables
# no package creation currently
# 17/01/2011 V1.5 distinguish library creation and installation
#
# ============================================================================
#
all: install
install: libemod.a
.PHONY: all
all: install
# efa.doc still uses deprecated tcl script
.PHONY: doc
doc:
LIBRARIES=libemod.a
.PHONY: install
install: $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) install
#----------------------------------------------------------------------
flist: Makefile $(wildcard *.f)
echo $^ | tr ' ' '\n' | sort > $@
......@@ -47,7 +65,7 @@ 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 *.a
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
......@@ -70,7 +88,6 @@ docs: $(DOCS)
libemod.a: $(LIBEMODSUB)
ar rcv libemod.a $(LIBEMODSUB)
ranlib libemod.a
/bin/mv -fv libemod.a $(LOCLIBDIR)
efa.doc: efa.f
extractdoc.tcl efa.f > efa.doc
......
......@@ -25,12 +25,23 @@
#
# REVISIONS and CHANGES
# 17/11/2010 V1.0 Thomas Forbriger
# 17/01/2011 V1.1 distinguish library creation and installation
#
# ============================================================================
#
.PHONY: all
all: install doxydoc
install: install-include libfapidxx.a libfapidxx.so
.PHONY: doc
doc: doxydoc
LIBRARIES=libfapidxx.a libfapidxx.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
# check mandatory environment variable settings
# ---------------------------------------------
......@@ -68,7 +79,7 @@ edit: flist; vim $<
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.h.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o fapidtest
-/bin/rm -vf flist *.o fapidtest *.a *.so
#======================================================================
# dependencies
......@@ -152,11 +163,9 @@ LIBOBS=$(patsubst %.f,%.o,$(patsubst %.cc,%.o,$(LIBSRC)))
libfapidxx.a: $(INSTHEADER) $(LIBOBS)
ar rcv $@ $(LIBOBS)
ranlib $@
/bin/mv -vf $@ $(LIBINSTALLPATH)
libfapidxx.so: $(INSTHEADER) $(LIBOBS)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBS)
/bin/mv -fv $@ $(LOCLIBDIR)
#======================================================================
# documentation part
......
......@@ -31,14 +31,26 @@
# 11.01.2011 V1.7 - renamed Fortran source code such that
# Fotran object files to not conflict with
# C++ object files
# 17/01/2011 V1.8 distinguish library creation and installation
#
# ============================================================================
#
all: install libfourier.doc doxydoc
install: install-include libfourier.a libfourierxx.a
.PHONY: all
all: install doc
.PHONY: doc
doc: doxydoc libfourier.doc
LIBRARIES=libfourier.a libfourierxx.a
#shared: libfourierxx.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
#----------------------------------------------------------------------
flist: Makefile $(wildcard *.f *.inc *.h *.cc *.c README *.cfg)
echo $^ | tr ' ' '\n' | sort > $@
......@@ -52,7 +64,7 @@ clean:
-find . -name \*.o | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.h.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o install-include *.xxx junk*
-/bin/rm -vf flist *.o install-include *.xxx junk* *.a *.so
# ============================================================================
#
......@@ -106,7 +118,6 @@ libfourier.a: $(LIBOBS)
%.a:
$(AR) rcv $@ $^
$(RANLIB) $@
/bin/mv -fv $@ $(LOCLIBDIR)
# ============================================================================
#
......@@ -188,12 +199,10 @@ LIBOBSXX=$(patsubst %.cc,%.o,$(SRC))
libfourierxx.a: install-include $(LIBOBSXX)
ar rcv $@ $(LIBOBSXX)
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
libfourierxx.so: install-include libfourier.a $(LIBOBSXX)
$(CXX) $(CXXFLAGS) -shared -o $@ $(LIBOBSXX) -lfourier \
-L$(LOCLIBDIR)
/bin/mv -fv $@ $(LOCLIBDIR)
#======================================================================
# dependencies
......
......@@ -54,14 +54,30 @@
# - copy headers (no symbolic links)
# - new doxygen definitions
# - package creation not yet implemented
# 17/01/2011 V1.4 distinguish library creation and installation
#
# ============================================================================
# general part
# ------------
#
all: install doxydoc
install: install-include libgsexx.a libgsexx.so
.PHONY: all
all: install doc
.PHONY: doc
doc: doxydoc
LIBRARIES=libgsexx.a libgsexx.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
# ============================================================================
# a variable definition to check variable settings
......@@ -92,7 +108,7 @@ edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.d *.o gsexx_tests
-/bin/rm -vf flist *.d *.o gsexx_tests *.a *.so
#======================================================================
# pattern rules
......@@ -119,15 +135,18 @@ $(LOCLIBDIR) $(LOCINCLUDEDIR): ; mkdir -pv $@
libgsexx.a: $(patsubst %.cc,%.o,$(LIBSRC)) $(LOCLIBDIR)
ar rcv $@ $(patsubst %.cc,%.o,$(LIBSRC))
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
libgsexx.so: $(patsubst %.cc,%.o,$(LIBSRC)) $(LOCLIBDIR)
$(CXX) $(CXXFLAGS) -shared -o $@ $(patsubst %.cc,%.o,$(LIBSRC))
/bin/mv -fv $@ $(LOCLIBDIR)
.PHONY: install-include
install-include: $(LOCINCLUDEDIR)
/bin/cp -fv gsexx.h $<
.PHONY: clean-include
clean-include:
-/bin/rm -fv $(LOCINCLUDEDIR)/gsexx.h
#======================================================================
# documentation part
# ------------------
......
......@@ -30,13 +30,23 @@
# - set TF_REMCMMNT to cat if not defined
# - new doxygen definitions
# - package creation not yet implemented
# 17/01/2011 V1.2 distinguish library creation and installation
#
# ============================================================================
#
all: install doxydoc
install: install-include liblinearxx.a
shared: liblinearxx.so
.PHONY: all
all: install doc
.PHONY: doc
doc: doxydoc
LIBRARIES=liblinearxx.a
# shared: liblinearxx.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
# ============================================================================
#
......@@ -95,7 +105,7 @@ edit: flist; vim $<
.PHONY: clean
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.d *.o */*.o */*.d *.strip */*.strip
-/bin/rm -vf flist *.d *.o */*.o */*.d *.strip */*.strip *.a *.so
#======================================================================
# pattern rules
......@@ -116,11 +126,9 @@ clean: ;
liblinearxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
liblinearxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^ -llapack -lblas $(LDFLAGS)
/bin/mv -fv $@ $(LOCLIBDIR)
#----------------------------------------------------------------------
# comment stripping
......
......@@ -33,12 +33,22 @@
# - new doxygen definitions
# - package creation not yet implemented
# - set TF_REMCMMNT to cat if not defined
# 17/01/2011 V1.4 distinguish library creation and installation
#
# ============================================================================
#
all: install example doxydoc
install: install-include libpgplotCpp.a libpgplotCpp.so
.PHONY: all
all: install doc example
.PHONY: doc
doc: doxydoc
LIBRARIES=libpgplotCpp.a libpgplotCpp.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
# ============================================================================
#
......@@ -64,7 +74,6 @@ EXSRC=pgtestxx.cc XpgplotCpp.cc
ROOTINCINSTALLPATH=$(LOCINCLUDEDIR)
INCINSTALLPATH=$(ROOTINCINSTALLPATH)/pgplotxx
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off
STRIPHEADER=$(addsuffix .strip,$(notdir $(HEADERS)))
......@@ -100,7 +109,7 @@ clean: ;
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.hd | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o install-include *.strip libtpgplotCpp.a
-/bin/rm -fv XpgplotCpp
-/bin/rm -fv XpgplotCpp *.so *.a
#======================================================================
# dependencies
......@@ -122,11 +131,9 @@ clean: ;
libpgplotCpp.a: $(SRC:.cc=.o)
ar rcv $@ $^
ranlib $@
/bin/mv -vf $@ $(LIBINSTALLPATH)
libpgplotCpp.so: $(SRC:.cc=.o)
$(CXX) $(CXXFLAGS) -shared -o $@ $^
/bin/mv -fv $@ $(LIBINSTALLPATH)
#----------------------------------------------------------------------
# comment stripping
......
......@@ -14,13 +14,26 @@
# discard f2c fallback option
# 17/11/2010 V1.2 migrated to SVN scheme
# removed incdep dependency
# 17/01/2011 V1.3 distinguish library creation and installation
#
# ============================================================================
#
# moved to gfortran
#
all: install
install: librheology.a rhetest install-include librheologyxx.a doxydoc
.PHONY: all
all: install doc rhetest
.PHONY: doc
doc: doxydoc
LIBRARIES=librheology.a librheologyxx.a
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
#----------------------------------------------------------------------
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
......@@ -50,7 +63,7 @@ clean: ;
-find . -name \*.o | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.h.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o install-include librheologyxx.a *.xxx junk*
-/bin/rm -vf flist *.o install-include librheologyxx.a *.xxx junk* *.a
flist: $(wildcard *.f) Makefile $(wildcard cxx/*.h cxx/*.cc)
echo $^ | tr ' ' '\n' | sort > $@
......@@ -67,7 +80,6 @@ LIBOBS=rl_sls.o rl_qtrans.o
librheology.a: $(LIBOBS)
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
rhetest: rhetest.o librheology.a
$(FC) -o $(LOCBINDIR)/rhetest rhetest.o -lrheology \
......@@ -108,8 +120,6 @@ SRC=$(wildcard $(CXXDIR)/*.cc)
# place where we will copy header files
INCINSTALLPATH=$(LOCINCLUDEDIR)
# place where we will copy the binary library
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off (these are linked to your include
# directory)
......@@ -198,7 +208,6 @@ LIBOBS=$(patsubst %.cc,%.o,$(SRC))
librheologyxx.a: install-include $(LIBOBS)
ar rcv $@ $(LIBOBS)
ranlib $@
cp -vpf $@ $(LIBINSTALLPATH)
#======================================================================
# documentation part
......
......@@ -30,11 +30,21 @@
# - new doxygen definitions
# - package creation not yet implemented
# - set TF_REMCMMNT to cat if not defined
# 17/01/2011 V1.2 distinguish library creation and installation
#
# ============================================================================
all: install doxydoc
install: install-include libserialxx.a libserialxx.so
.PHONY: all
all: install doc
.PHONY: doc
doc: doxydoc
LIBRARIES=libserialxx.a libserialxx.so
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
#=============================================================================
......@@ -53,7 +63,6 @@ LIBSRC=$(wildcard *.cc)
TESTSRC=$(wildcard tests/*.cc)
INCINSTALLPATH=$(LOCINCLUDEDIR)/serialxx
LIBINSTALLPATH=$(LOCLIBDIR)
# name of headers with comments stripped off
STRIPHEADER=$(addsuffix .strip,$(notdir $(HEADERS)))
......@@ -93,7 +102,7 @@ clean: ;
-find . -name \*.o | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.d | xargs --no-run-if-empty /bin/rm -v
-find . -name \*.strip | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist
-/bin/rm -vf flist *.a *.so
#======================================================================
# pattern rules
......@@ -114,11 +123,9 @@ clean: ;
libserialxx.a: $(patsubst %.cc,%.o,$(LIBSRC))
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
libserialxx.so: $(patsubst %.cc,%.o,$(LIBSRC))
$(CXX) $(CXXFLAGS) -shared -o $@ $^
/bin/mv -fv $@ $(LOCLIBDIR)
#----------------------------------------------------------------------
# comment stripping
......
......@@ -32,16 +32,28 @@
# check variables
# creation of package not yet defined
# 14/11/2010 V1.5 provide C prototypes to stuff.f
# 17/01/2011 V1.6 distinguish library creation and installation
#
# ============================================================================
#
all: doc install
.PHONY: all
all: install doc $(TESTS)
LIBS=libsff.a
TESTS=tfullwrite tservice tskipdata teststuff tfullread
.PHONY: doc
doc: libsff.doc sff.doc
install: $(LIBS) install-include
LIBRARIES=libsff.a
.PHONY: install
install: install-include $(LIBRARIES)
/bin/mv -fv $(LIBRARIES) $(LOCLIBDIR)
.PHONY: reinstall
reinstall: