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

Added VPATH

This commit is contained in:
Anthony Scemama 2021-05-09 01:27:07 +02:00
parent 8479039078
commit e2ee986032
3 changed files with 27 additions and 21 deletions

View File

@ -10,11 +10,14 @@ tarname = $(package)
distdir = $(tarname)-$(version)
prefix = @prefix@
QMCKL_ROOT=$(CURDIR)
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/$(package)/fortran/qmckl_f.f90
# VPATH-related substitution variables
srcdir = @srcdir@
VPATH = @srcdir@
shared_lib=$(srcdir)/lib/libqmckl.so
static_lib=$(srcdir)/lib/libqmckl.a
qmckl_h=$(srcdir)/include/qmckl.h
qmckl_f=$(srcdir)/share/$(package)/fortran/qmckl_f.f90
datarootdir=$(prefix)/share
datadir=$(datarootdir)
@ -36,7 +39,7 @@ $(distdir).tar.gz: $(distdir)
rm -rf $(distdir)
$(distdir): $(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) src/Makefile.generated doc FORCE
$(distdir): $(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) $(srcdir)/src/Makefile.generated doc FORCE
mkdir -p $(distdir)
mkdir -p $(distdir)/munit
mkdir -p $(distdir)/src
@ -45,19 +48,19 @@ $(distdir): $(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) src/Makefile.gener
mkdir -p $(distdir)/share/doc/qmckl/html/
mkdir -p $(distdir)/share/doc/qmckl/text/
mkdir -p $(distdir)/man
cp $(QMCKL_ROOT)/munit/munit.h munit/munit.c $(distdir)/munit/
cp $(QMCKL_ROOT)/src/*.c src/*.h src/*.f90 $(distdir)/src/
cp $(QMCKL_ROOT)/src/Makefile.generated.in $(distdir)/src/Makefile.in
cp $(QMCKL_ROOT)/config.h.in $(distdir)/config.h.in
cp $(srcdir)/munit/munit.h munit/munit.c $(distdir)/munit/
cp $(srcdir)/src/*.c src/*.h src/*.f90 $(distdir)/src/
cp $(srcdir)/src/Makefile.generated.in $(distdir)/src/Makefile.in
cp $(srcdir)/config.h.in $(distdir)/config.h.in
cp $(qmckl_h) $(distdir)/include
cp $(QMCKL_ROOT)/Makefile.in $(distdir)/
cp $(QMCKL_ROOT)/share/doc/qmckl/html/*.html $(distdir)/share/doc/qmckl/html/
cp $(QMCKL_ROOT)/share/doc/qmckl/html/*.css $(distdir)/share/doc/qmckl/html/
cp $(QMCKL_ROOT)/share/doc/qmckl/text/*.txt $(distdir)/share/doc/qmckl/text/
cp $(srcdir)/Makefile.in $(distdir)/
cp $(srcdir)/share/doc/qmckl/html/*.html $(distdir)/share/doc/qmckl/html/
cp $(srcdir)/share/doc/qmckl/html/*.css $(distdir)/share/doc/qmckl/html/
cp $(srcdir)/share/doc/qmckl/text/*.txt $(distdir)/share/doc/qmckl/text/
cp $(qmckl_f) $(distdir)/share/qmckl/fortran/
cp $(QMCKL_ROOT)/configure.ac.dist $(distdir)/configure.ac
cp $(QMCKL_ROOT)/qmckl.pc.in $(distdir)/qmckl.pc.in
cp -r $(QMCKL_ROOT)/m4 $(distdir)/m4
cp $(srcdir)/configure.ac.dist $(distdir)/configure.ac
cp $(srcdir)/qmckl.pc.in $(distdir)/qmckl.pc.in
cp -r $(srcdir)/m4 $(distdir)/m4
mkdir -p $(distdir)/lib
cd $(distdir) && ../autogen.sh
@ -87,7 +90,7 @@ distcheck: $(distdir).tar.gz
$(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib):
$(MAKE) -C src $@
src/Makefile.generated:
$(srcdir)/src/Makefile.generated:
$(MAKE) -C src Makefile.generated
veryclean: FORCE clean

View File

@ -1,5 +1,5 @@
#!/bin/bash
automake --add-missing --copy 2> /dev/null
autoreconf -i
autoreconf --install
automake --add-missing --copy > /dev/null 2>&1

View File

@ -99,8 +99,11 @@ LDFLAGS = @LDFLAGS@
#+begin_src makefile
HAS_CPPCHECK = @HAS_CPPCHECK@
QMCKL_ROOT=$(shell dirname $(CURDIR))
# VPATH-related substitution variables
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