mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2024-08-14 16:58:38 +02:00
Improve build system
This commit is contained in:
parent
66d606ff1e
commit
8b9b671c84
@ -235,3 +235,4 @@
|
|||||||
|
|
||||||
/* Define as `fork' if `vfork' does not work. */
|
/* Define as `fork' if `vfork' does not work. */
|
||||||
#undef vfork
|
#undef vfork
|
||||||
|
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
.POSIX:
|
.POSIX:
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
||||||
package = @PACKAGE_TARNAME@
|
package = @PACKAGE_TARNAME@
|
||||||
version = @PACKAGE_VERSION@
|
version = @PACKAGE_VERSION@
|
||||||
|
|
||||||
|
# VPATH-related substitution variables
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I$(srcdir)
|
CFLAGS = @CFLAGS@ -I$(top_srcdir)/munit/ -I$(top_srcdir)/include -I.
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
|
|
||||||
@ -23,12 +27,12 @@ TESTS_F = test_qmckl_ao_f.o test_qmckl_distance_f.o
|
|||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
FCLIBS = @FCLIBS@
|
FCLIBS = @FCLIBS@
|
||||||
|
|
||||||
QMCKL_ROOT=..
|
top_srcdir=$(srcdir)/..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(top_srcdir)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(top_srcdir)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(top_srcdir)/include/qmckl.h
|
||||||
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
|
||||||
munit=$(QMCKL_ROOT)/munit/munit.c
|
munit=$(top_srcdir)/munit/munit.c
|
||||||
|
|
||||||
datarootdir=$(prefix)/share
|
datarootdir=$(prefix)/share
|
||||||
datadir=$(datarootdir)
|
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)
|
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
|
$(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 $@
|
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
check: test_qmckl test_qmckl_shared
|
check: test_qmckl test_qmckl_shared
|
||||||
@ -85,9 +89,9 @@ install:
|
|||||||
install $(static_lib) $(DESTDIR)$(libdir)/
|
install $(static_lib) $(DESTDIR)$(libdir)/
|
||||||
install $(qmckl_h) $(DESTDIR)$(includedir)
|
install $(qmckl_h) $(DESTDIR)$(includedir)
|
||||||
install $(qmckl_f) $(DESTDIR)$(fortrandir)
|
install $(qmckl_f) $(DESTDIR)$(fortrandir)
|
||||||
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
|
install $(top_srcdir)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
|
||||||
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
|
install $(top_srcdir)/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/text/*.txt $(DESTDIR)$(docdir)/text/
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm $(DESTDIR)$(libdir)/libqmckl.so
|
rm $(DESTDIR)$(libdir)/libqmckl.so
|
||||||
|
@ -29,17 +29,17 @@ HAS_CPPCHECK = @HAS_CPPCHECK@
|
|||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
|
||||||
QMCKL_ROOT=$(srcdir)/..
|
top_srcdir=$(srcdir)/..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(top_srcdir)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(top_srcdir)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(top_srcdir)/include/qmckl.h
|
||||||
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
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))
|
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
|
||||||
INCLUDE=-I$(QMCKL_ROOT)/include/
|
INCLUDE=-I$(top_srcdir)/include/
|
||||||
|
|
||||||
# Rules
|
# Rules
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ install uninstall: Makefile.generated
|
|||||||
$(MAKE) -f Makefile.generated $@
|
$(MAKE) -f Makefile.generated $@
|
||||||
|
|
||||||
$(qmckl_f) $(qmckl_h): 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)
|
shared: $(shared_lib)
|
||||||
static: $(static_lib)
|
static: $(static_lib)
|
||||||
@ -75,7 +75,7 @@ cppcheck:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
doc: $(ORG_SOURCE_FILES)
|
doc: $(ORG_SOURCE_FILES)
|
||||||
$(QMCKL_ROOT)/tools/build_doc.sh
|
$(top_srcdir)/tools/build_doc.sh
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
- $(MAKE) -f Makefile.generated clean
|
- $(MAKE) -f Makefile.generated clean
|
||||||
@ -85,11 +85,11 @@ clean:
|
|||||||
Makefile.generated *.html *.txt
|
Makefile.generated *.html *.txt
|
||||||
|
|
||||||
veryclean: clean FORCE
|
veryclean: clean FORCE
|
||||||
- $(RM) $(QMCKL_ROOT)/share/doc/qmckl/html/*.html \
|
- $(RM) $(top_srcdir)/share/doc/qmckl/html/*.html \
|
||||||
$(QMCKL_ROOT)/share/doc/qmckl/text/*.txt
|
$(top_srcdir)/share/doc/qmckl/text/*.txt
|
||||||
|
|
||||||
Makefile.generated.in: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) ../tools/Building.org
|
Makefile.generated.in: Makefile $(top_srcdir)/tools/create_makefile.sh $(ORG_SOURCE_FILES) $(top_srcdir)/tools/Building.org
|
||||||
$(QMCKL_ROOT)/tools/create_makefile.sh
|
$(top_srcdir)/tools/create_makefile.sh
|
||||||
|
|
||||||
Makefile.generated: Makefile.generated.in
|
Makefile.generated: Makefile.generated.in
|
||||||
cd .. ; ./config.status
|
cd .. ; ./config.status
|
||||||
@ -97,4 +97,4 @@ Makefile.generated: Makefile.generated.in
|
|||||||
.SUFFIXES: .org .c
|
.SUFFIXES: .org .c
|
||||||
|
|
||||||
.org.c:
|
.org.c:
|
||||||
$(QMCKL_ROOT)/tools/tangle.sh $<
|
$(top_srcdir)/tools/tangle.sh $<
|
||||||
|
@ -49,7 +49,7 @@ gradients and Laplacian of the atomic basis functions.
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -59,11 +59,16 @@ MunitResult test_<<filename()>>() {
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
@ -17,7 +17,12 @@ MunitResult test_<<filename()>>() {
|
|||||||
#ifndef QMCKL_CONTEXT_HPT
|
#ifndef QMCKL_CONTEXT_HPT
|
||||||
#define QMCKL_CONTEXT_HPT
|
#define QMCKL_CONTEXT_HPT
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#include "qmckl_error_private_type.h"
|
#include "qmckl_error_private_type.h"
|
||||||
@ -28,10 +33,16 @@ MunitResult test_<<filename()>>() {
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -12,7 +12,7 @@ Functions for the computation of distances between particles.
|
|||||||
#+begin_src c :comments link :tangle (eval c_test) :noweb yes
|
#+begin_src c :comments link :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
|
@ -21,7 +21,7 @@ up-spin and down-spin electrons, and the electron coordinates.
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
@ -30,10 +30,16 @@ MunitResult test_<<filename()>>() {
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
@ -10,10 +10,16 @@
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
@ -30,7 +36,7 @@
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
|
@ -9,10 +9,16 @@ optimized libraries to fine-tune the memory allocation.
|
|||||||
* Headers :noexport:
|
* Headers :noexport:
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.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
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
#include "qmckl_context_private_type.h"
|
#include "qmckl_context_private_type.h"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#+begin_src c :tangle (eval c_test) :noweb yes
|
#+begin_src c :tangle (eval c_test) :noweb yes
|
||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
MunitResult test_<<filename()>>() {
|
MunitResult test_<<filename()>>() {
|
||||||
@ -17,14 +17,24 @@ MunitResult test_<<filename()>>() {
|
|||||||
#ifndef QMCKL_NUMPREC_HPT
|
#ifndef QMCKL_NUMPREC_HPT
|
||||||
#define QMCKL_NUMPREC_HPT
|
#define QMCKL_NUMPREC_HPT
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src c :tangle (eval c)
|
#+begin_src c :tangle (eval c)
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#elif HAVE_INTTYPES_H
|
||||||
|
#include <inttypes.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -82,7 +82,7 @@ echo "#+end_src"
|
|||||||
#include "qmckl.h"
|
#include "qmckl.h"
|
||||||
#include "munit.h"
|
#include "munit.h"
|
||||||
#include "mcheck.h"
|
#include "mcheck.h"
|
||||||
#if HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
<<headers>>
|
<<headers>>
|
||||||
|
@ -104,17 +104,17 @@ HAS_CPPCHECK = @HAS_CPPCHECK@
|
|||||||
srcdir = @srcdir@
|
srcdir = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
|
|
||||||
QMCKL_ROOT=$(srcdir)/..
|
top_srcdir=$(srcdir)/..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(top_srcdir)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(top_srcdir)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(top_srcdir)/include/qmckl.h
|
||||||
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
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))
|
C_SOURCE_FILES=$(patsubst %.org,%.c,$(ORG_SOURCE_FILES))
|
||||||
INCLUDE=-I$(QMCKL_ROOT)/include/
|
INCLUDE=-I$(top_srcdir)/include/
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
*** Rules
|
*** Rules
|
||||||
@ -133,7 +133,7 @@ install uninstall: Makefile.generated
|
|||||||
$(MAKE) -f Makefile.generated $@
|
$(MAKE) -f Makefile.generated $@
|
||||||
|
|
||||||
$(qmckl_f) $(qmckl_h): 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)
|
shared: $(shared_lib)
|
||||||
static: $(static_lib)
|
static: $(static_lib)
|
||||||
@ -151,7 +151,7 @@ cppcheck:
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
doc: $(ORG_SOURCE_FILES)
|
doc: $(ORG_SOURCE_FILES)
|
||||||
$(QMCKL_ROOT)/tools/build_doc.sh
|
$(top_srcdir)/tools/build_doc.sh
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
- $(MAKE) -f Makefile.generated clean
|
- $(MAKE) -f Makefile.generated clean
|
||||||
@ -161,11 +161,11 @@ clean:
|
|||||||
Makefile.generated *.html *.txt
|
Makefile.generated *.html *.txt
|
||||||
|
|
||||||
veryclean: clean FORCE
|
veryclean: clean FORCE
|
||||||
- $(RM) $(QMCKL_ROOT)/share/doc/qmckl/html/*.html \
|
- $(RM) $(top_srcdir)/share/doc/qmckl/html/*.html \
|
||||||
$(QMCKL_ROOT)/share/doc/qmckl/text/*.txt
|
$(top_srcdir)/share/doc/qmckl/text/*.txt
|
||||||
|
|
||||||
Makefile.generated.in: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES) ../tools/Building.org
|
Makefile.generated.in: Makefile $(top_srcdir)/tools/create_makefile.sh $(ORG_SOURCE_FILES) $(top_srcdir)/tools/Building.org
|
||||||
$(QMCKL_ROOT)/tools/create_makefile.sh
|
$(top_srcdir)/tools/create_makefile.sh
|
||||||
|
|
||||||
Makefile.generated: Makefile.generated.in
|
Makefile.generated: Makefile.generated.in
|
||||||
cd .. ; ./config.status
|
cd .. ; ./config.status
|
||||||
@ -173,7 +173,7 @@ Makefile.generated: Makefile.generated.in
|
|||||||
.SUFFIXES: .org .c
|
.SUFFIXES: .org .c
|
||||||
|
|
||||||
.org.c:
|
.org.c:
|
||||||
$(QMCKL_ROOT)/tools/tangle.sh $<
|
$(top_srcdir)/tools/tangle.sh $<
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
@ -197,8 +197,8 @@ OUTPUT=Makefile.generated.in
|
|||||||
We start by tangling all the org-mode files.
|
We start by tangling all the org-mode files.
|
||||||
|
|
||||||
#+begin_src bash
|
#+begin_src bash
|
||||||
${QMCKL_ROOT}/tools/tangle.sh *.org
|
${top_srcdir}/tools/tangle.sh *.org
|
||||||
${QMCKL_ROOT}/tools/build_qmckl_h.sh
|
${top_srcdir}/tools/build_qmckl_h.sh
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Then we create the list of ~*.o~ files to be created, for library
|
Then we create the list of ~*.o~ files to be created, for library
|
||||||
@ -239,14 +239,18 @@ cat << EOF > ${OUTPUT}
|
|||||||
.POSIX:
|
.POSIX:
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
||||||
package = @PACKAGE_TARNAME@
|
package = @PACKAGE_TARNAME@
|
||||||
version = @PACKAGE_VERSION@
|
version = @PACKAGE_VERSION@
|
||||||
|
|
||||||
|
# VPATH-related substitution variables
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I\$(srcdir)
|
CFLAGS = @CFLAGS@ -I\$(top_srcdir)/munit/ -I\$(top_srcdir)/include -I.
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
|
|
||||||
@ -262,6 +266,7 @@ LIBS = @LIBS@
|
|||||||
FCLIBS = @FCLIBS@
|
FCLIBS = @FCLIBS@
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
export
|
||||||
echo '
|
echo '
|
||||||
<<rules>>
|
<<rules>>
|
||||||
' >> ${OUTPUT}
|
' >> ${OUTPUT}
|
||||||
@ -272,12 +277,12 @@ and the rules:
|
|||||||
|
|
||||||
#+NAME: rules
|
#+NAME: rules
|
||||||
#+begin_src makefile :tangle no
|
#+begin_src makefile :tangle no
|
||||||
QMCKL_ROOT=..
|
top_srcdir=$(srcdir)/..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(top_srcdir)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(top_srcdir)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(top_srcdir)/include/qmckl.h
|
||||||
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
|
||||||
munit=$(QMCKL_ROOT)/munit/munit.c
|
munit=$(top_srcdir)/munit/munit.c
|
||||||
|
|
||||||
datarootdir=$(prefix)/share
|
datarootdir=$(prefix)/share
|
||||||
datadir=$(datarootdir)
|
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)
|
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
|
$(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 $@
|
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
check: test_qmckl test_qmckl_shared
|
check: test_qmckl test_qmckl_shared
|
||||||
@ -334,9 +339,9 @@ install:
|
|||||||
install $(static_lib) $(DESTDIR)$(libdir)/
|
install $(static_lib) $(DESTDIR)$(libdir)/
|
||||||
install $(qmckl_h) $(DESTDIR)$(includedir)
|
install $(qmckl_h) $(DESTDIR)$(includedir)
|
||||||
install $(qmckl_f) $(DESTDIR)$(fortrandir)
|
install $(qmckl_f) $(DESTDIR)$(fortrandir)
|
||||||
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
|
install $(top_srcdir)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
|
||||||
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
|
install $(top_srcdir)/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/text/*.txt $(DESTDIR)$(docdir)/text/
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm $(DESTDIR)$(libdir)/libqmckl.so
|
rm $(DESTDIR)$(libdir)/libqmckl.so
|
||||||
@ -389,7 +394,7 @@ function tangle()
|
|||||||
elif [[ ${org_file} -ot ${f_file} ]] ; then
|
elif [[ ${org_file} -ot ${f_file} ]] ; then
|
||||||
return
|
return
|
||||||
fi
|
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 $@
|
for i in $@
|
||||||
@ -445,7 +450,7 @@ done
|
|||||||
Generate C header file
|
Generate C header file
|
||||||
|
|
||||||
#+begin_src bash
|
#+begin_src bash
|
||||||
OUTPUT="../include/qmckl.h"
|
OUTPUT="${top_srcdir}/include/qmckl.h"
|
||||||
|
|
||||||
cat << EOF > ${OUTPUT}
|
cat << EOF > ${OUTPUT}
|
||||||
/*
|
/*
|
||||||
@ -478,7 +483,7 @@ EOF
|
|||||||
HEADERS_TYPE="qmckl_*_fh_type.f90"
|
HEADERS_TYPE="qmckl_*_fh_type.f90"
|
||||||
HEADERS="qmckl_*_fh_func.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}
|
cat << EOF > ${OUTPUT}
|
||||||
!
|
!
|
||||||
! <<qmckl-header>>
|
! <<qmckl-header>>
|
||||||
@ -510,11 +515,11 @@ EOF
|
|||||||
First define readonly global variables.
|
First define readonly global variables.
|
||||||
|
|
||||||
#+begin_src bash :noweb yes
|
#+begin_src bash :noweb yes
|
||||||
readonly DOCS=${QMCKL_ROOT}/share/doc/qmckl/
|
readonly DOCS=${top_srcdir}/share/doc/qmckl/
|
||||||
readonly SRC=${QMCKL_ROOT}/src/
|
readonly SRC=${top_srcdir}/src/
|
||||||
readonly HTMLIZE=${DOCS}/html/htmlize.el
|
readonly HTMLIZE=${DOCS}/html/htmlize.el
|
||||||
readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el
|
readonly CONFIG_DOC=${top_srcdir}/tools/config_doc.el
|
||||||
readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.el
|
readonly CONFIG_TANGLE=${top_srcdir}/tools/config_tangle.el
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Check that all the defined global variables correspond to files.
|
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
|
#+begin_src bash :noweb yes
|
||||||
function check_preconditions()
|
function check_preconditions()
|
||||||
{
|
{
|
||||||
if [[ -z ${QMCKL_ROOT} ]]
|
if [[ -z ${top_srcdir} ]]
|
||||||
then
|
then
|
||||||
print "QMCKL_ROOT is not defined"
|
print "top_srcdir is not defined"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@
|
|||||||
# First define readonly global variables.
|
# First define readonly global variables.
|
||||||
|
|
||||||
|
|
||||||
readonly DOCS=${QMCKL_ROOT}/share/doc/qmckl/
|
readonly DOCS=${top_srcdir}/share/doc/qmckl/
|
||||||
readonly SRC=${QMCKL_ROOT}/src/
|
readonly SRC=${top_srcdir}/src/
|
||||||
readonly HTMLIZE=${DOCS}/html/htmlize.el
|
readonly HTMLIZE=${DOCS}/html/htmlize.el
|
||||||
readonly CONFIG_DOC=${QMCKL_ROOT}/tools/config_doc.el
|
readonly CONFIG_DOC=${top_srcdir}/tools/config_doc.el
|
||||||
readonly CONFIG_TANGLE=${QMCKL_ROOT}/tools/config_tangle.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()
|
function check_preconditions()
|
||||||
{
|
{
|
||||||
if [[ -z ${QMCKL_ROOT} ]]
|
if [[ -z ${top_srcdir} ]]
|
||||||
then
|
then
|
||||||
print "QMCKL_ROOT is not defined"
|
print "top_srcdir is not defined"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ done
|
|||||||
# Generate C header file
|
# Generate C header file
|
||||||
|
|
||||||
|
|
||||||
OUTPUT="../include/qmckl.h"
|
OUTPUT="${top_srcdir}/include/qmckl.h"
|
||||||
|
|
||||||
cat << EOF > ${OUTPUT}
|
cat << EOF > ${OUTPUT}
|
||||||
/*
|
/*
|
||||||
@ -105,7 +105,7 @@ EOF
|
|||||||
HEADERS_TYPE="qmckl_*_fh_type.f90"
|
HEADERS_TYPE="qmckl_*_fh_type.f90"
|
||||||
HEADERS="qmckl_*_fh_func.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}
|
cat << EOF > ${OUTPUT}
|
||||||
!
|
!
|
||||||
! ------------------------------------------
|
! ------------------------------------------
|
||||||
|
@ -20,8 +20,8 @@ OUTPUT=Makefile.generated.in
|
|||||||
# We start by tangling all the org-mode files.
|
# We start by tangling all the org-mode files.
|
||||||
|
|
||||||
|
|
||||||
${QMCKL_ROOT}/tools/tangle.sh *.org
|
${top_srcdir}/tools/tangle.sh *.org
|
||||||
${QMCKL_ROOT}/tools/build_qmckl_h.sh
|
${top_srcdir}/tools/build_qmckl_h.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -66,14 +66,18 @@ cat << EOF > ${OUTPUT}
|
|||||||
.POSIX:
|
.POSIX:
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
|
|
||||||
package = @PACKAGE_TARNAME@
|
package = @PACKAGE_TARNAME@
|
||||||
version = @PACKAGE_VERSION@
|
version = @PACKAGE_VERSION@
|
||||||
|
|
||||||
|
# VPATH-related substitution variables
|
||||||
|
srcdir = @srcdir@
|
||||||
|
VPATH = @srcdir@
|
||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
DEFS = @DEFS@
|
DEFS = @DEFS@
|
||||||
CFLAGS = @CFLAGS@ -I../munit/ -I../include -I. -I\$(srcdir)
|
CFLAGS = @CFLAGS@ -I\$(top_srcdir)/munit/ -I\$(top_srcdir)/include -I.
|
||||||
CPPFLAGS = @CPPFLAGS@
|
CPPFLAGS = @CPPFLAGS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
|
|
||||||
@ -89,13 +93,14 @@ LIBS = @LIBS@
|
|||||||
FCLIBS = @FCLIBS@
|
FCLIBS = @FCLIBS@
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
export
|
||||||
echo '
|
echo '
|
||||||
QMCKL_ROOT=..
|
top_srcdir=$(srcdir)/..
|
||||||
shared_lib=$(QMCKL_ROOT)/lib/libqmckl.so
|
shared_lib=$(top_srcdir)/lib/libqmckl.so
|
||||||
static_lib=$(QMCKL_ROOT)/lib/libqmckl.a
|
static_lib=$(top_srcdir)/lib/libqmckl.a
|
||||||
qmckl_h=$(QMCKL_ROOT)/include/qmckl.h
|
qmckl_h=$(top_srcdir)/include/qmckl.h
|
||||||
qmckl_f=$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
|
qmckl_f=$(top_srcdir)/share/qmckl/fortran/qmckl_f.f90
|
||||||
munit=$(QMCKL_ROOT)/munit/munit.c
|
munit=$(top_srcdir)/munit/munit.c
|
||||||
|
|
||||||
datarootdir=$(prefix)/share
|
datarootdir=$(prefix)/share
|
||||||
datadir=$(datarootdir)
|
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)
|
test_qmckl_shared: test_qmckl.c $(qmckl_h) $(shared_lib) $(TESTS) $(TESTS_F)
|
||||||
$(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) \
|
$(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 $@
|
$(TESTS_F) -lqmckl $(LIBS) $(FCLIBS) test_qmckl.c -o $@
|
||||||
|
|
||||||
check: test_qmckl test_qmckl_shared
|
check: test_qmckl test_qmckl_shared
|
||||||
@ -152,9 +157,9 @@ install:
|
|||||||
install $(static_lib) $(DESTDIR)$(libdir)/
|
install $(static_lib) $(DESTDIR)$(libdir)/
|
||||||
install $(qmckl_h) $(DESTDIR)$(includedir)
|
install $(qmckl_h) $(DESTDIR)$(includedir)
|
||||||
install $(qmckl_f) $(DESTDIR)$(fortrandir)
|
install $(qmckl_f) $(DESTDIR)$(fortrandir)
|
||||||
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
|
install $(top_srcdir)/share/doc/qmckl/html/*.html $(DESTDIR)$(docdir)/html/
|
||||||
install $(QMCKL_ROOT)/share/doc/qmckl/html/*.css $(DESTDIR)$(docdir)/html/
|
install $(top_srcdir)/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/text/*.txt $(DESTDIR)$(docdir)/text/
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm $(DESTDIR)$(libdir)/libqmckl.so
|
rm $(DESTDIR)$(libdir)/libqmckl.so
|
||||||
|
@ -31,7 +31,7 @@ function tangle()
|
|||||||
elif [[ ${org_file} -ot ${f_file} ]] ; then
|
elif [[ ${org_file} -ot ${f_file} ]] ; then
|
||||||
return
|
return
|
||||||
fi
|
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 $@
|
for i in $@
|
||||||
|
Loading…
Reference in New Issue
Block a user