2021-04-20 19:05:45 +02:00
|
|
|
# Use POSIX-compliant Makefiles
|
|
|
|
.POSIX:
|
|
|
|
|
|
|
|
# Clear suffix list
|
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
package = qmckl
|
|
|
|
version = 0.1-alpha
|
|
|
|
tarname = $(package)
|
|
|
|
distdir = $(tarname)-$(version)
|
2021-04-21 12:44:03 +02:00
|
|
|
prefix = /usr/local
|
2021-04-20 19:05:45 +02:00
|
|
|
|
2021-04-21 12:44:03 +02:00
|
|
|
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
|
2021-04-20 19:05:45 +02:00
|
|
|
|
2021-04-21 12:44:03 +02:00
|
|
|
export prefix shared_lib static_lib qmckl_h qmckl_f
|
|
|
|
|
|
|
|
|
|
|
|
all clean doc check install uninstall:
|
2021-04-20 19:05:45 +02:00
|
|
|
$(MAKE) -C src $@
|
|
|
|
|
|
|
|
dist: $(distdir).tar.gz
|
|
|
|
|
|
|
|
|
|
|
|
$(distdir).tar.gz: $(distdir)
|
|
|
|
tar chof - $(distdir) | gzip -9 -c > $@
|
|
|
|
rm -rf $(distdir)
|
|
|
|
|
|
|
|
|
2021-04-21 12:44:03 +02:00
|
|
|
$(distdir): $(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) src/Makefile.generated doc FORCE
|
2021-04-20 19:05:45 +02:00
|
|
|
mkdir -p $(distdir)
|
|
|
|
mkdir -p $(distdir)/munit
|
|
|
|
mkdir -p $(distdir)/src
|
|
|
|
mkdir -p $(distdir)/include
|
2021-04-21 12:44:03 +02:00
|
|
|
mkdir -p $(distdir)/share/qmckl/fortran
|
|
|
|
mkdir -p $(distdir)/share/qmckl/doc/html/
|
|
|
|
mkdir -p $(distdir)/share/qmckl/doc/text/
|
|
|
|
mkdir -p $(distdir)/man
|
|
|
|
cp munit/munit.h munit/munit.c $(distdir)/munit/
|
|
|
|
cp src/*.c src/*.h src/*.f90 $(distdir)/src/
|
2021-04-20 19:05:45 +02:00
|
|
|
cp src/Makefile.generated $(distdir)/src/Makefile
|
|
|
|
cp include/* $(distdir)/include
|
|
|
|
cp Makefile $(distdir)/
|
2021-04-21 12:44:03 +02:00
|
|
|
cp docs/*.html $(distdir)/share/qmckl/doc/html/
|
|
|
|
cp docs/*.css $(distdir)/share/qmckl/doc/html/
|
|
|
|
cp docs/*.txt $(distdir)/share/qmckl/doc/text/
|
|
|
|
cp share/qmckl/fortran/* $(distdir)/share/qmckl/fortran
|
2021-04-20 19:05:45 +02:00
|
|
|
mkdir -p $(distdir)/lib
|
|
|
|
|
|
|
|
|
|
|
|
FORCE:
|
2021-04-21 13:26:11 +02:00
|
|
|
rm -f -- $(distdir).tar.gz
|
|
|
|
rm -rf -- $(distdir)
|
2021-04-20 19:05:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
distcheck: $(distdir).tar.gz
|
|
|
|
gzip -cd $(distdir).tar.gz | tar xvf -
|
|
|
|
cd $(distdir) && $(MAKE) all check
|
|
|
|
rm $(distdir)/lib/libqmckl.so $(distdir)/include/qmckl.h \
|
|
|
|
$(distdir)/include/qmckl_f.f90
|
|
|
|
cd $(distdir) && $(MAKE) clean
|
|
|
|
rm -rf $(distdir)
|
|
|
|
@echo "*** Package $(distdir).tar.gz is ready for distribution."
|
|
|
|
|
|
|
|
|
2021-04-21 12:44:03 +02:00
|
|
|
$(qmckl_h) $(qmckl_f) $(static_lib) $(shared_lib) src/Makefile.generated:
|
|
|
|
$(MAKE) -C src $@
|
2021-04-20 19:05:45 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-21 12:44:03 +02:00
|
|
|
.PHONY: all clean dist doc install uninstall FORCE
|