1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-12-22 20:36:01 +01:00

Improve build system

This commit is contained in:
Anthony Scemama 2021-05-10 10:05:50 +02:00
parent 66d606ff1e
commit 8b9b671c84
16 changed files with 164 additions and 105 deletions

View File

@ -235,3 +235,4 @@
/* Define as `fork' if `vfork' does not work. */
#undef vfork

View File

@ -1,14 +1,18 @@
.POSIX:
.SUFFIXES:
package = @PACKAGE_TARNAME@
version = @PACKAGE_VERSION@
package = @PACKAGE_TARNAME@
version = @PACKAGE_VERSION@
# VPATH-related substitution variables
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
CC = @CC@
DEFS = @DEFS@
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I$(srcdir)
CFLAGS = @CFLAGS@ -I$(top_srcdir)/munit/ -I$(top_srcdir)/include -I.
CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
@ -23,12 +27,12 @@ TESTS_F = test_qmckl_ao_f.o test_qmckl_distance_f.o
LIBS = @LIBS@
FCLIBS = @FCLIBS@
QMCKL_ROOT=..
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
munit=$(QMCKL_ROOT)/munit/munit.c
top_srcdir=$(srcdir)/..
shared_lib=$(top_srcdir)/lib/libqmckl.so
static_lib=$(top_srcdir)/lib/libqmckl.a
qmckl_h=$(top_srcdir)/include/qmckl.h
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
munit=$(top_srcdir)/munit/munit.c
datarootdir=$(prefix)/share
datadir=$(datarootdir)
@ -63,7 +67,7 @@ test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
-Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib $(munit) $(TESTS) \
-Wl,-rpath,$(top_srcdir)/lib -L$(top_srcdir)/lib $(munit) $(TESTS) \
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
check: test_qmckl test_qmckl_shared
@ -85,9 +89,9 @@ install:
install $(static_lib) $(DESTDIR)$(libdir)/
install $(qmckl_h) $(DESTDIR)$(includedir)
install $(qmckl_f) $(DESTDIR)$(fortrandir)
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
install $(QMCKL_ROOT)/share/doc/qmckl/text/*.txt $(DESTDIR)$(docdir)/text/
install $(top_srcdir)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
install $(top_srcdir)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
install $(top_srcdir)/share/doc/qmckl/text/*.txt $(DESTDIR)$(docdir)/text/
uninstall:
rm $(DESTDIR)$(libdir)/libqmckl.so

View File

@ -29,17 +29,17 @@ HAS_CPPCHECK = @HAS_CPPCHECK@
srcdir = @srcdir@
VPATH = @srcdir@
QMCKL_ROOT=$(srcdir)/..
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
top_srcdir=$(srcdir)/..
shared_lib=$(top_srcdir)/lib/libqmckl.so
static_lib=$(top_srcdir)/lib/libqmckl.a
qmckl_h=$(top_srcdir)/include/qmckl.h
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
export CC CFLAGS DEFS FC FCFLAGS LIBS QMCKL_ROOT
export CC CFLAGS DEFS FC FCFLAGS LIBS top_srcdir
ORG_SOURCE_FILES=$(wildcard $(QMCKL_ROOT)/*.org)
ORG_SOURCE_FILES=$(wildcard $(srcdir)/*.org)
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
INCLUDE=-I$(QMCKL_ROOT)/include/
INCLUDE=-I$(top_srcdir)/include/
# Rules
@ -57,7 +57,7 @@ install uninstall: Makefile.generated
$(MAKE) -f Makefile.generated $@
$(qmckl_f) $(qmckl_h): Makefile.generated
$(QMCKL_ROOT)/tools/build_qmckl_h.sh
$(top_srcdir)/tools/build_qmckl_h.sh
shared: $(shared_lib)
static: $(static_lib)
@ -75,7 +75,7 @@ cppcheck:
endif
doc: $(ORG_SOURCE_FILES)
$(QMCKL_ROOT)/tools/build_doc.sh
$(top_srcdir)/tools/build_doc.sh
clean:
- $(MAKE) -f Makefile.generated clean
@ -85,11 +85,11 @@ clean:
Makefile.generated *.html *.txt
veryclean: clean FORCE
- $(RM) $(QMCKL_ROOT)/share/doc/qmckl/html/*.html \
$(QMCKL_ROOT)/share/doc/qmckl/text/*.txt
- $(RM) $(top_srcdir)/share/doc/qmckl/html/*.html \
$(top_srcdir)/share/doc/qmckl/text/*.txt
Makefile.generated.in: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) ../tools/Building.org
$(QMCKL_ROOT)/tools/create_makefile.sh
Makefile.generated.in: Makefile $(top_srcdir)/tools/create_makefile.sh $(ORG_SOURCE_FILES) $(top_srcdir)/tools/Building.org
$(top_srcdir)/tools/create_makefile.sh
Makefile.generated: Makefile.generated.in
cd .. ; ./config.status
@ -97,4 +97,4 @@ Makefile.generated: Makefile.generated.in
.SUFFIXES: .org .c
.org.c:
$(QMCKL_ROOT)/tools/tangle.sh $<
$(top_srcdir)/tools/tangle.sh $<

View File

@ -49,7 +49,7 @@ gradients and Laplacian of the atomic basis functions.
#+begin_src c :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "munit.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@ -59,11 +59,16 @@ MunitResult test_<<filename()>>() {
#+end_src
#+begin_src c :tangle (eval c)
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

View File

@ -7,7 +7,7 @@
#+begin_src c :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "munit.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
MunitResult test_<<filename()>>() {
@ -17,7 +17,12 @@ MunitResult test_<<filename()>>() {
#ifndef QMCKL_CONTEXT_HPT
#define QMCKL_CONTEXT_HPT
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <pthread.h>
#include "qmckl_error_private_type.h"
@ -28,10 +33,16 @@ MunitResult test_<<filename()>>() {
#+end_src
#+begin_src c :tangle (eval c)
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <assert.h>
#include <math.h>
#include <stdlib.h>

View File

@ -12,7 +12,7 @@ Functions for the computation of distances between particles.
#+begin_src c :comments link :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "munit.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
MunitResult test_<<filename()>>() {

View File

@ -21,7 +21,7 @@ up-spin and down-spin electrons, and the electron coordinates.
#+begin_src c :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "munit.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
MunitResult test_<<filename()>>() {
@ -30,10 +30,16 @@ MunitResult test_<<filename()>>() {
#+end_src
#+begin_src c :tangle (eval c)
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

View File

@ -10,10 +10,16 @@
#+end_src
#+begin_src c :tangle (eval c)
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <string.h>
#include <assert.h>
#include <pthread.h>
@ -30,7 +36,7 @@
#+begin_src c :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "munit.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
MunitResult test_<<filename()>>() {

View File

@ -9,10 +9,16 @@ optimized libraries to fine-tune the memory allocation.
* Headers :noexport:
#+begin_src c :tangle (eval c)
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <assert.h>
@ -31,7 +37,7 @@ optimized libraries to fine-tune the memory allocation.
#+begin_src c :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "munit.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qmckl_context_private_type.h"

View File

@ -7,7 +7,7 @@
#+begin_src c :tangle (eval c_test) :noweb yes
#include "qmckl.h"
#include "munit.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
MunitResult test_<<filename()>>() {
@ -17,14 +17,24 @@ MunitResult test_<<filename()>>() {
#ifndef QMCKL_NUMPREC_HPT
#define QMCKL_NUMPREC_HPT
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#+end_src
#+begin_src c :tangle (eval c)
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#elif HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#include <assert.h>
#include <math.h>
#include <stdlib.h>

View File

@ -82,7 +82,7 @@ echo "#+end_src"
#include "qmckl.h"
#include "munit.h"
#include "mcheck.h"
#if HAVE_CONFIG_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
<<headers>>

View File

@ -104,17 +104,17 @@ HAS_CPPCHECK = @HAS_CPPCHECK@
srcdir = @srcdir@
VPATH = @srcdir@
QMCKL_ROOT=$(srcdir)/..
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
top_srcdir=$(srcdir)/..
shared_lib=$(top_srcdir)/lib/libqmckl.so
static_lib=$(top_srcdir)/lib/libqmckl.a
qmckl_h=$(top_srcdir)/include/qmckl.h
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
export CC CFLAGS DEFS FC FCFLAGS LIBS QMCKL_ROOT
export CC CFLAGS DEFS FC FCFLAGS LIBS top_srcdir
ORG_SOURCE_FILES=$(wildcard $(QMCKL_ROOT)/*.org)
ORG_SOURCE_FILES=$(wildcard $(srcdir)/*.org)
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
INCLUDE=-I$(QMCKL_ROOT)/include/
INCLUDE=-I$(top_srcdir)/include/
#+end_src
*** Rules
@ -133,7 +133,7 @@ install uninstall: Makefile.generated
$(MAKE) -f Makefile.generated $@
$(qmckl_f) $(qmckl_h): Makefile.generated
$(QMCKL_ROOT)/tools/build_qmckl_h.sh
$(top_srcdir)/tools/build_qmckl_h.sh
shared: $(shared_lib)
static: $(static_lib)
@ -151,7 +151,7 @@ cppcheck:
endif
doc: $(ORG_SOURCE_FILES)
$(QMCKL_ROOT)/tools/build_doc.sh
$(top_srcdir)/tools/build_doc.sh
clean:
- $(MAKE) -f Makefile.generated clean
@ -161,11 +161,11 @@ clean:
Makefile.generated *.html *.txt
veryclean: clean FORCE
- $(RM) $(QMCKL_ROOT)/share/doc/qmckl/html/*.html \
$(QMCKL_ROOT)/share/doc/qmckl/text/*.txt
- $(RM) $(top_srcdir)/share/doc/qmckl/html/*.html \
$(top_srcdir)/share/doc/qmckl/text/*.txt
Makefile.generated.in: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) ../tools/Building.org
$(QMCKL_ROOT)/tools/create_makefile.sh
Makefile.generated.in: Makefile $(top_srcdir)/tools/create_makefile.sh $(ORG_SOURCE_FILES) $(top_srcdir)/tools/Building.org
$(top_srcdir)/tools/create_makefile.sh
Makefile.generated: Makefile.generated.in
cd .. ; ./config.status
@ -173,7 +173,7 @@ Makefile.generated: Makefile.generated.in
.SUFFIXES: .org .c
.org.c:
$(QMCKL_ROOT)/tools/tangle.sh $<
$(top_srcdir)/tools/tangle.sh $<
#+end_src
@ -197,8 +197,8 @@ OUTPUT=Makefile.generated.in
We start by tangling all the org-mode files.
#+begin_src bash
${QMCKL_ROOT}/tools/tangle.sh *.org
${QMCKL_ROOT}/tools/build_qmckl_h.sh
${top_srcdir}/tools/tangle.sh *.org
${top_srcdir}/tools/build_qmckl_h.sh
#+end_src
Then we create the list of ~*.o~ files to be created, for library
@ -239,14 +239,18 @@ cat << EOF > ${OUTPUT}
.POSIX:
.SUFFIXES:
package = @PACKAGE_TARNAME@
version = @PACKAGE_VERSION@
package = @PACKAGE_TARNAME@
version = @PACKAGE_VERSION@
# VPATH-related substitution variables
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
CC = @CC@
DEFS = @DEFS@
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I\$(srcdir)
CFLAGS = @CFLAGS@ -I\$(top_srcdir)/munit/ -I\$(top_srcdir)/include -I.
CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
@ -262,6 +266,7 @@ LIBS = @LIBS@
FCLIBS = @FCLIBS@
EOF
export
echo '
<<rules>>
' >> ${OUTPUT}
@ -272,12 +277,12 @@ and the rules:
#+NAME: rules
#+begin_src makefile :tangle no
QMCKL_ROOT=..
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
munit=$(QMCKL_ROOT)/munit/munit.c
top_srcdir=$(srcdir)/..
shared_lib=$(top_srcdir)/lib/libqmckl.so
static_lib=$(top_srcdir)/lib/libqmckl.a
qmckl_h=$(top_srcdir)/include/qmckl.h
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
munit=$(top_srcdir)/munit/munit.c
datarootdir=$(prefix)/share
datadir=$(datarootdir)
@ -312,7 +317,7 @@ test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
-Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib $(munit) $(TESTS) \
-Wl,-rpath,$(top_srcdir)/lib -L$(top_srcdir)/lib $(munit) $(TESTS) \
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
check: test_qmckl test_qmckl_shared
@ -334,9 +339,9 @@ install:
install $(static_lib) $(DESTDIR)$(libdir)/
install $(qmckl_h) $(DESTDIR)$(includedir)
install $(qmckl_f) $(DESTDIR)$(fortrandir)
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
install $(QMCKL_ROOT)/share/doc/qmckl/text/*.txt $(DESTDIR)$(docdir)/text/
install $(top_srcdir)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
install $(top_srcdir)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
install $(top_srcdir)/share/doc/qmckl/text/*.txt $(DESTDIR)$(docdir)/text/
uninstall:
rm $(DESTDIR)$(libdir)/libqmckl.so
@ -389,7 +394,7 @@ function tangle()
elif [[ ${org_file} -ot ${f_file} ]] ; then
return
fi
emacs --batch ${org_file} --load=../tools/config_tangle.el -f org-babel-tangle
emacs --batch ${org_file} --load=${top_srcdir}/tools/config_tangle.el -f org-babel-tangle
}
for i in $@
@ -445,7 +450,7 @@ done
Generate C header file
#+begin_src bash
OUTPUT="../include/qmckl.h"
OUTPUT="${top_srcdir}/include/qmckl.h"
cat << EOF > ${OUTPUT}
/*
@ -478,7 +483,7 @@ EOF
HEADERS_TYPE="qmckl_*_fh_type.f90"
HEADERS="qmckl_*_fh_func.f90"
OUTPUT="../share/qmckl/fortran/qmckl_f.f90"
OUTPUT="${top_srcdir}/share/qmckl/fortran/qmckl_f.f90"
cat << EOF > ${OUTPUT}
!
! <<qmckl-header>>
@ -510,11 +515,11 @@ EOF
First define readonly global variables.
#+begin_src bash :noweb yes
readonly DOCS=${QMCKL_ROOT}/share/doc/qmckl/
readonly SRC=${QMCKL_ROOT}/src/
readonly DOCS=${top_srcdir}/share/doc/qmckl/
readonly SRC=${top_srcdir}/src/
readonly HTMLIZE=${DOCS}/html/htmlize.el
readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el
readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el
readonly CONFIG_DOC=${top_srcdir}/tools/config_doc.el
readonly CONFIG_TANGLE=${top_srcdir}/tools/config_tangle.el
#+end_src
Check that all the defined global variables correspond to files.
@ -522,9 +527,9 @@ readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el
#+begin_src bash :noweb yes
function check_preconditions()
{
if [[ -z ${QMCKL_ROOT} ]]
if [[ -z ${top_srcdir} ]]
then
print "QMCKL_ROOT is not defined"
print "top_srcdir is not defined"
exit 1
fi

View File

@ -7,11 +7,11 @@
# First define readonly global variables.
readonly DOCS=${QMCKL_ROOT}/share/doc/qmckl/
readonly SRC=${QMCKL_ROOT}/src/
readonly DOCS=${top_srcdir}/share/doc/qmckl/
readonly SRC=${top_srcdir}/src/
readonly HTMLIZE=${DOCS}/html/htmlize.el
readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el
readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el
readonly CONFIG_DOC=${top_srcdir}/tools/config_doc.el
readonly CONFIG_TANGLE=${top_srcdir}/tools/config_tangle.el
@ -20,9 +20,9 @@ readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el
function check_preconditions()
{
if [[ -z ${QMCKL_ROOT} ]]
if [[ -z ${top_srcdir} ]]
then
print "QMCKL_ROOT is not defined"
print "top_srcdir is not defined"
exit 1
fi

View File

@ -32,7 +32,7 @@ done
# Generate C header file
OUTPUT="../include/qmckl.h"
OUTPUT="${top_srcdir}/include/qmckl.h"
cat << EOF > ${OUTPUT}
/*
@ -105,7 +105,7 @@ EOF
HEADERS_TYPE="qmckl_*_fh_type.f90"
HEADERS="qmckl_*_fh_func.f90"
OUTPUT="../share/qmckl/fortran/qmckl_f.f90"
OUTPUT="${top_srcdir}/share/qmckl/fortran/qmckl_f.f90"
cat << EOF > ${OUTPUT}
!
! ------------------------------------------

View File

@ -20,8 +20,8 @@ OUTPUT=Makefile.generated.in
# We start by tangling all the org-mode files.
${QMCKL_ROOT}/tools/tangle.sh *.org
${QMCKL_ROOT}/tools/build_qmckl_h.sh
${top_srcdir}/tools/tangle.sh *.org
${top_srcdir}/tools/build_qmckl_h.sh
@ -66,14 +66,18 @@ cat << EOF > ${OUTPUT}
.POSIX:
.SUFFIXES:
package = @PACKAGE_TARNAME@
version = @PACKAGE_VERSION@
package = @PACKAGE_TARNAME@
version = @PACKAGE_VERSION@
# VPATH-related substitution variables
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
CC = @CC@
DEFS = @DEFS@
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I\$(srcdir)
CFLAGS = @CFLAGS@ -I\$(top_srcdir)/munit/ -I\$(top_srcdir)/include -I.
CPPFLAGS = @CPPFLAGS@
LIBS = @LIBS@
@ -89,13 +93,14 @@ LIBS = @LIBS@
FCLIBS = @FCLIBS@
EOF
export
echo '
QMCKL_ROOT=..
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
munit=$(QMCKL_ROOT)/munit/munit.c
top_srcdir=$(srcdir)/..
shared_lib=$(top_srcdir)/lib/libqmckl.so
static_lib=$(top_srcdir)/lib/libqmckl.a
qmckl_h=$(top_srcdir)/include/qmckl.h
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
munit=$(top_srcdir)/munit/munit.c
datarootdir=$(prefix)/share
datadir=$(datarootdir)
@ -130,7 +135,7 @@ test_qmckl: test_qmckl.c $(qmckl_h) $(static_lib) $(TESTS) $(TESTS_F)
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
-Wl,-rpath,$(QMCKL_ROOT)/lib -L$(QMCKL_ROOT)/lib $(munit) $(TESTS) \
-Wl,-rpath,$(top_srcdir)/lib -L$(top_srcdir)/lib $(munit) $(TESTS) \
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
check: test_qmckl test_qmckl_shared
@ -152,9 +157,9 @@ install:
install $(static_lib) $(DESTDIR)$(libdir)/
install $(qmckl_h) $(DESTDIR)$(includedir)
install $(qmckl_f) $(DESTDIR)$(fortrandir)
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
install $(QMCKL_ROOT)/share/doc/qmckl/text/*.txt $(DESTDIR)$(docdir)/text/
install $(top_srcdir)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
install $(top_srcdir)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
install $(top_srcdir)/share/doc/qmckl/text/*.txt $(DESTDIR)$(docdir)/text/
uninstall:
rm $(DESTDIR)$(libdir)/libqmckl.so

View File

@ -31,7 +31,7 @@ function tangle()
elif [[ ${org_file} -ot ${f_file} ]] ; then
return
fi
emacs --batch ${org_file} --load=../tools/config_tangle.el -f org-babel-tangle
emacs --batch ${org_file} --load=${top_srcdir}/tools/config_tangle.el -f org-babel-tangle
}
for i in $@