1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2025-01-03 01:56:18 +01:00

Complete build OK

This commit is contained in:
Anthony Scemama 2021-05-12 00:22:51 +02:00
parent 0ee57d06e0
commit 4adcfa1df4
9 changed files with 103 additions and 102 deletions

2
.gitignore vendored
View File

@ -27,3 +27,5 @@ test-driver
.dirstamp
*.la
*.lo
qmckl-*.tar.gz
qmckl.mod

View File

@ -39,15 +39,16 @@ VERSION_PATCH = @VERSION_PATCH@
SUBDIRS =
CLEANFILES =
EXTRA_DIST =
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(srcdir)/qmckl.pc
pkgconfig_DATA = pkgconfig/qmckl.pc
qmckl_h = $(srcdir)/include/qmckl.h
include_HEADERS = $(qmckl_h)
qmckl_f = $(srcdir)/share/qmckl/fortran/qmckl_f.f90
qmckl_fo = $(srcdir)/share/qmckl/fortran/qmckl_f.$(OBJEXT)
qmckl_f = share/qmckl/fortran/qmckl_f.f90
qmckl_fo = share/qmckl/fortran/qmckl_f.$(OBJEXT)
test_qmckl_f = $(srcdir)/tests/qmckl_f.f90
src_qmckl_f = $(srcdir)/src/qmckl_f.f90
@ -55,14 +56,15 @@ fortrandir = $(datadir)/$(PACKAGE_NAME)/fortran/
fortran_DATA = $(qmckl_f)
AM_CPPFLAGS = -I$(srcdir)/src -I$(srcdir)/include
EXTRA_DIST = share/doc/qmckl/
lib_LTLIBRARIES = src/libqmckl.la
src_libqmckl_la_SOURCES = $(qmckl_h) $(src_qmckl_f) $(C_FILES) $(F_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES)
export srcdir qmckl_f qmckl_h
CLEANFILES+=$(test_qmckl_f)
CLEANFILES+=$(test_qmckl_f) $(src_qmckl_f) $(qmckl_h) $(qmckl_f)
htmlize_el=$(srcdir)/share/doc/qmckl/html/htmlize.el
include $(srcdir)/generated.mk
@ -72,6 +74,13 @@ else
include Makefile.dist.mk
endif
htmldir = $(docdir)/html
html_DATA = $(HTML_FILES) $(htmlize_el) $(srcdir)/share/doc/qmckl/html/index.html
textdir = $(docdir)/text
text_DATA = $(TEXT_FILES)
$(srcdir)/generated.mk: $(ORG_FILES)
$(srcdir)/tools/build_makefile.sh
@ -81,6 +90,10 @@ $(test_qmckl_f): $(qmckl_f)
$(src_qmckl_f): $(qmckl_f)
cp $(qmckl_f) $(src_qmckl_f)
$(srcdir)/share/doc/qmckl/html/index.html: $(srcdir)/share/doc/qmckl/html/README.html
mv -f $(srcdir)/share/doc/qmckl/html/README.html \
$(srcdir)/share/doc/qmckl/html/index.html
rpms srcrpm:
for dir in $(SUBDIRS); do \
(cd $$dir && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1; \

View File

@ -33,12 +33,30 @@
dist_src_DATA = $(ORG_FILES)
BUILT_SOURCES = $(C_FILES) $(F_FILES) $(FH_FUNC_FILES) $(FH_TYPE_FILES) $(H_FUNC_FILES) $(H_TYPE_FILES) $(H_PRIVATE_FUNC_FILES) $(H_PRIVATE_TYPE_FILES) $(qmckl_f) $(qmckl_h)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(qmckl_f) $(qmckl_h)
CLEANFILES += $(BUILT_SOURCES) $(C_TEST_FILES) $(F_TEST_FILES) $(TANGLED_FILES) $(C_TEST_FILES) $(F_TEST_FILES) $(qmckl_f) $(qmckl_h) $(HTML_FILES) $(TEXT_FILES) $(srcdir)/share/doc/qmckl/html/index.html
EXTRA_DIST += \
tools/build_doc.sh \
tools/build_makefile.sh \
tools/build_qmckl_f.sh \
tools/build_qmckl_h.sh \
tools/config_doc.el \
tools/config_tangle.el \
tools/init.el \
tools/install_htmlize.sh \
tools/lib.org \
tools/tangle.sh \
tools/theme.setup
## Silent
## ======
export_verbose = $(export_verbose_@AM_V@)
export_verbose_ = $(export_verbose_@AM_DEFAULT_V@)
export_verbose_0 = @echo " DOC $<";
tangle_verbose = $(tangle_verbose_@AM_V@)
tangle_verbose_ = $(tangle_verbose_@AM_DEFAULT_V@)
tangle_verbose_0 = @echo " TANGLE $<";
@ -59,5 +77,8 @@ $(qmckl_h): $(H_FUNC_FILES) $(H_TYPE_FILES)
$(qmckl_f): $(FH_FUNC_FILES) $(FH_TYPE_FILES)
$(cat_h_verbose)$(srcdir)/tools/build_qmckl_f.sh
$(htmlize_el):
$(srcdir)/tools/install_htmlize.sh $(htmlize_el)
# vim: syntax=automake noet

View File

@ -204,7 +204,7 @@ AC_SUBST([PKG_LIBS])
AC_SUBST([PKG_CFLAGS])
AC_CONFIG_FILES([Makefile
qmckl.pc
pkgconfig/qmckl.pc
])

1
org/.gitignore vendored
View File

@ -1 +1,2 @@
*.tangled
*.exported

View File

@ -1,5 +1,5 @@
#!/bin/bash
# Script to build the documentation.
# Extracts documentation from an org-mode file.
set -e
@ -11,104 +11,34 @@ readonly HTMLIZE=${DOCS}/html/htmlize.el
readonly CONFIG_DOC=${srcdir}/tools/config_doc.el
readonly CONFIG_TANGLE=${srcdir}/tools/config_tangle.el
# Checks that all the defined global variables correspond to files.
for dir in ${DOCS}/html ${DOCS}/text ${ORG}
do
if [[ ! -d ${dir} ]]
then
print "${dir} not found"
exit 2
fi
done
for file in ${CONFIG_DOC} ${CONFIG_TANGLE}
do
if [[ ! -f ${file} ]]
then
print "${file} not found"
exit 3
fi
done
function install_htmlize()
{
# Installs the htmlize Emacs plugin if the =htmlize.el= file is not present.
local url="https://github.com/hniksic/emacs-htmlize"
local repo="emacs-htmlize"
[[ -f ${HTMLIZE} ]] || (
cd ${DOCS}/html
${srcdir}/missing git clone ${url} \
&& cp ${repo}/htmlize.el ${HTMLIZE} \
&& rm -rf ${repo}
cd -
)
# Assert htmlize is installed
[[ -f ${HTMLIZE} ]] \
|| exit 1
}
function extract_doc()
{
# Extracts documentation from an org-mode file.
org=$1
local_html=${org%.org}.html
local_text=${org%.org}.txt
html=${DOCS}/html/$(basename ${org%.org}.html)
text=${DOCS}/text/$(basename ${org%.org}.txt)
local org=$1
local local_html=${ORG}/${org%.org}.html
local local_text=${ORG}/${org%.org}.txt
local html=${DOCS}/html/${org%.org}.html
local text=${DOCS}/text/${org%.org}.txt
if [[ -f ${html} && ${org} -ot ${html} ]]
then
return
fi
${srcdir}/missing emacs --batch \
./missing emacs --batch \
--load ${HTMLIZE} \
--load ${CONFIG_DOC} \
${org} \
--load ${CONFIG_TANGLE} \
-f org-html-export-to-html \
-f org-ascii-export-to-ascii
mv ${local_html} ${DOCS}/html
mv ${local_text} ${DOCS}/text
mv ${local_html} ${html}
mv ${local_text} ${text}
}
function main() {
# Install htmlize if needed
install_htmlize || exit 2
# Create documentation
cd ${ORG} \
|| exit 3
for i in *.org
for i in $@
do
echo "======= ${i} ======="
extract_doc ${i}
exported=${i%.org}.exported
NOW=$(date +"%m%d%H%M.%S")
extract_doc ${i} &> $exported
# Make log file older than the exported files
touch -t ${NOW} $exported
done
if [[ $? -eq 0 ]]
then
cd ${DOCS}/html
rm -f index.html
ln README.html index.html
exit 0
else
exit 3
fi
}
main

View File

@ -15,7 +15,7 @@ function make_src()
cd ${srcdir}
declare -A DEPS DEPS_ORG DEPS_TEST TESTS
declare -A DEPS DEPS_ORG DEPS_TEST TESTS HTML TEXT DEPS_DOC
C_FILES=
F_FILES=
@ -32,11 +32,14 @@ function make_src()
for org in org/*.org ; do
i=$(basename ${org%.org})
tangled="\$(srcdir)/org/${i}.tangled"
exported="\$(srcdir)/org/${i}.exported"
c_test_x="\$(srcdir)/tests/test_${i}"
c_test_o="\$(srcdir)/tests/test_${i}.o"
f_test_o="\$(srcdir)/tests/test_${i}_f.o"
c_test="\$(srcdir)/tests/test_${i}.c"
f_test="\$(srcdir)/tests/test_${i}_f.f90"
html="\$(srcdir)/share/doc/qmckl/html/${i}.html"
text="\$(srcdir)/share/doc/qmckl/text/${i}.txt"
i="\$(srcdir)/src/${i}"
@ -53,7 +56,11 @@ function make_src()
ORG_FILES+="\$(srcdir)/$org "
TANGLED_FILES+="$tangled "
EXPORTED_FILES+="$exported "
DEPS_ORG["\$(srcdir)/$org"]=$tangled
DEPS_DOC["\$(srcdir)/$org"]=$exported
TEXT["\$(srcdir)/$org"]=$text
HTML["\$(srcdir)/$org"]=$html
grep -q "(eval c)" $org
if [[ $? -eq 0 ]] ; then
@ -129,6 +136,7 @@ function make_src()
echo
echo "ORG_FILES=${ORG_FILES}"
echo "TANGLED_FILES=${TANGLED_FILES}"
echo "EXPORTED_FILES=${EXPORTED_FILES}"
echo "C_FILES=${C_FILES}"
echo "F_FILES=${F_FILES}"
echo "C_O_FILES=${C_O_FILES}"
@ -142,6 +150,8 @@ function make_src()
echo "C_TEST_FILES=${C_TEST_FILES}"
echo "F_TEST_FILES=${F_TEST_FILES}"
echo "TESTS=${!TESTS[@]}" | sed "s|\$(srcdir)/||g"
echo "HTML_FILES"=${HTML[@]}
echo "TEXT_FILES"=${TEXT[@]}
echo
echo
@ -172,7 +182,22 @@ function make_src()
for f in ${!TESTS[@]} ; do
echo "tests_$(basename $f)_SOURCES = ${TESTS[$f]}" #| sed "s|\$(srcdir)/||"
echo "tests_$(basename $f)_LDADD = src/libqmckl.la"
echo "tests_$(basename $f)_LDFLAGS = -no-install"
done | sort
echo
echo "## Documentation"
echo
for f in ${ORG_FILES} ; do
echo "${HTML[$f]}: ${DEPS_DOC[$f]} \$(htmlize_el)"
echo "${TEXT[$f]}: ${DEPS_DOC[$f]}"
echo ""
done
for f in ${!DEPS_DOC[@]} ; do
echo "${DEPS_DOC[$f]}: $f"
echo " \$(export_verbose)\$(srcdir)/tools/build_doc.sh $f"
echo ""
done
}

9
tools/install_htmlize.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
#
# Installs the htmlize Emacs plugin
./missing git clone "https://github.com/hniksic/emacs-htmlize"
mv emacs-htmlize/htmlize.el $1
rm -rf emacs-htmlize