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

Added DESTDIR in Makefile

This commit is contained in:
Anthony Scemama 2021-04-30 01:55:50 +02:00
parent 58f4113a99
commit c2d02f755b
4 changed files with 69 additions and 43 deletions

View File

@ -14,14 +14,16 @@ 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/qmckl/fortran/qmckl_f.f90
qmckl_f=$(QMCKL_ROOT)/share/$(package)/fortran/qmckl_f.f90
docdir=$(prefix)/share/doc/qmckl
datarootdir=$(prefix)/share
datadir=$(datarootdir)
docdir=$(datarootdir)/doc/$(package)
libdir=$(prefix)/lib
includedir=$(prefix)/include
fortrandir=$(prefix)/share/qmckl/fortran
fortrandir=$(datarootdir)/$(package)/fortran
export prefix shared_lib static_lib qmckl_h qmckl_f
export prefix shared_lib static_lib qmckl_h qmckl_f datarootdir datadir docdir libdir includedir fortrandir package
all clean doc install uninstall check:
@ -64,8 +66,8 @@ distcheck: $(distdir).tar.gz
gzip -cd $(distdir).tar.gz | tar xvf -
cd $(distdir) && $(MAKE) all
cd $(distdir) && $(MAKE) check
cd $(distdir) && $(MAKE) prefix=$${PWD}/_inst install
cd $(distdir) && $(MAKE) prefix=$${PWD}/_inst uninstall
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst install
cd $(distdir) && $(MAKE) DESTDIR=$${PWD}/_inst uninstall
@remaining="`find $${PWD}/$(distdir)/_inst -type f | wc -l`" ;\
if test "$${remaining}" -ne 0; then \
echo "*** $${remaining} file(s) remaining in stage directory"; \

View File

@ -113,9 +113,9 @@ check: $(static_lib)
cppcheck:
cppcheck \
--addon=cert \
--enable=warning,style,performance,portability,information \
qmckl_*.c
--addon=cert \
--enable=warning,style,performance,portability,information \
qmckl_*.c
doc: $(ORG_SOURCE_FILES)
$(QMCKL_ROOT)/tools/build_doc.sh

View File

@ -340,8 +340,20 @@ qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
munit=\$(QMCKL_ROOT)/munit/munit.c
package=qmckl
datarootdir=\$(prefix)/share
datadir=\$(datarootdir)
docdir=\$(datarootdir)/doc/\$(package)
htmldir=\$(docdir)/html
libdir=\$(prefix)/lib
includedir=\$(prefix)/include
fortrandir=\$(datarootdir)/\$(package)/fortran
shared: \$(shared_lib)
static: \$(static_lib)
all: shared static
\$(shared_lib): \$(OBJECT_FILES)
@ -374,25 +386,25 @@ clean:
install:
install -d \$(prefix)/lib
install -d \$(prefix)/include
install -d \$(prefix)/share/qmckl/fortran
install -d \$(prefix)/share/doc/qmckl/html/
install -d \$(prefix)/share/doc/qmckl/text/
install \$(shared_lib) \$(prefix)/lib
install \$(static_lib) \$(prefix)/lib
install \$(qmckl_h) \$(prefix)/include
install \$(qmckl_f) \$(prefix)/share/qmckl/fortran
install \$(QMCKL_ROOT)/share/doc/qmckl/html/*.html \$(prefix)/share/doc/qmckl/html/
install \$(QMCKL_ROOT)/share/doc/qmckl/html/*.css \$(prefix)/share/doc/qmckl/html/
install \$(QMCKL_ROOT)/share/doc/qmckl/text/*.txt \$(prefix)/share/doc/qmckl/text/
install -d \$(DESTDIR)\$(prefix)/lib
install -d \$(DESTDIR)\$(prefix)/include
install -d \$(DESTDIR)\$(prefix)/share/qmckl/fortran
install -d \$(DESTDIR)\$(prefix)/share/doc/qmckl/html/
install -d \$(DESTDIR)\$(prefix)/share/doc/qmckl/text/
install \$(shared_lib) \$(DESTDIR)\$(libdir)/
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/
uninstall:
rm \$(prefix)/lib/libqmckl.so
rm \$(prefix)/lib/libqmckl.a
rm \$(prefix)/include/qmckl.h
rm -rf \$(prefix)/share/qmckl/
rm -rf \$(prefix)/share/doc/qmckl/
rm \$(DESTDIR)\$(libdir)/libqmckl.so
rm \$(DESTDIR)\$(libdir)/libqmckl.a
rm \$(DESTDIR)\$(includedir)/qmckl.h
rm -rf \$(DESTDIR)\$(datarootdir)/\$(package)
rm -rf \$(DESTDIR)\$(docdir)
.SUFFIXES: .c .f90 .o

View File

@ -87,8 +87,20 @@ qmckl_h=\$(QMCKL_ROOT)/include/qmckl.h
qmckl_f=\$(QMCKL_ROOT)/share/qmckl/fortran/qmckl_f.f90
munit=\$(QMCKL_ROOT)/munit/munit.c
package=qmckl
datarootdir=\$(prefix)/share
datadir=\$(datarootdir)
docdir=\$(datarootdir)/doc/\$(package)
htmldir=\$(docdir)/html
libdir=\$(prefix)/lib
includedir=\$(prefix)/include
fortrandir=\$(datarootdir)/\$(package)/fortran
shared: \$(shared_lib)
static: \$(static_lib)
all: shared static
\$(shared_lib): \$(OBJECT_FILES)
@ -121,25 +133,25 @@ clean:
install:
install -d \$(prefix)/lib
install -d \$(prefix)/include
install -d \$(prefix)/share/qmckl/fortran
install -d \$(prefix)/share/doc/qmckl/html/
install -d \$(prefix)/share/doc/qmckl/text/
install \$(shared_lib) \$(prefix)/lib
install \$(static_lib) \$(prefix)/lib
install \$(qmckl_h) \$(prefix)/include
install \$(qmckl_f) \$(prefix)/share/qmckl/fortran
install \$(QMCKL_ROOT)/share/doc/qmckl/html/*.html \$(prefix)/share/doc/qmckl/html/
install \$(QMCKL_ROOT)/share/doc/qmckl/html/*.css \$(prefix)/share/doc/qmckl/html/
install \$(QMCKL_ROOT)/share/doc/qmckl/text/*.txt \$(prefix)/share/doc/qmckl/text/
install -d \$(DESTDIR)\$(prefix)/lib
install -d \$(DESTDIR)\$(prefix)/include
install -d \$(DESTDIR)\$(prefix)/share/qmckl/fortran
install -d \$(DESTDIR)\$(prefix)/share/doc/qmckl/html/
install -d \$(DESTDIR)\$(prefix)/share/doc/qmckl/text/
install \$(shared_lib) \$(DESTDIR)\$(libdir)/
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/
uninstall:
rm \$(prefix)/lib/libqmckl.so
rm \$(prefix)/lib/libqmckl.a
rm \$(prefix)/include/qmckl.h
rm -rf \$(prefix)/share/qmckl/
rm -rf \$(prefix)/share/doc/qmckl/
rm \$(DESTDIR)\$(libdir)/libqmckl.so
rm \$(DESTDIR)\$(libdir)/libqmckl.a
rm \$(DESTDIR)\$(includedir)/qmckl.h
rm -rf \$(DESTDIR)\$(datarootdir)/\$(package)
rm -rf \$(DESTDIR)\$(docdir)
.SUFFIXES: .c .f90 .o