mirror of
https://github.com/TREX-CoE/qmckl.git
synced 2025-01-05 11:00:36 +01:00
Fixed makefile
This commit is contained in:
parent
d7a922b24e
commit
f03cff153e
11
src/Makefile
11
src/Makefile
@ -34,9 +34,10 @@ LIBS=-lm
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
export CC CFLAGS FC FFLAGS LIBS
|
QMCKL_ROOT=$(PWD)/..
|
||||||
|
|
||||||
|
export CC CFLAGS FC FFLAGS LIBS QMCKL_ROOT
|
||||||
|
|
||||||
MERGED_ORG=merged_qmckl.org
|
|
||||||
ORG_SOURCE_FILES=$(wildcard *.org)
|
ORG_SOURCE_FILES=$(wildcard *.org)
|
||||||
OBJECT_FILES=$(filter-out $(EXCLUDED_OBJECTS), $(patsubst %.org,%.o,$(ORG_SOURCE_FILES)))
|
OBJECT_FILES=$(filter-out $(EXCLUDED_OBJECTS), $(patsubst %.org,%.o,$(ORG_SOURCE_FILES)))
|
||||||
|
|
||||||
@ -51,12 +52,12 @@ test: Makefile.generated
|
|||||||
|
|
||||||
|
|
||||||
doc: $(ORG_SOURCE_FILES)
|
doc: $(ORG_SOURCE_FILES)
|
||||||
./create_doc.sh $(MERGED_ORG)
|
$(QMCKL_ROOT)/tools/create_doc.sh
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f qmckl.h test_qmckl_* test_qmckl.c test_qmckl qmckl_*.f90 qmckl_*.c qmckl_*.o qmckl_*.h Makefile.generated libqmckl.so *.html *.fh *.mod
|
rm -f qmckl.h test_qmckl_* test_qmckl.c test_qmckl qmckl_*.f90 qmckl_*.c qmckl_*.o qmckl_*.h Makefile.generated libqmckl.so *.html *.fh *.mod
|
||||||
|
|
||||||
Makefile.generated: Makefile create_makefile.sh $(ORG_SOURCE_FILES)
|
Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES)
|
||||||
./create_makefile.sh $(MERGED_ORG)
|
$(QMCKL_ROOT)/tools/create_makefile.sh
|
||||||
|
|
||||||
|
@ -241,3 +241,6 @@
|
|||||||
|
|
||||||
* Documentation
|
* Documentation
|
||||||
|
|
||||||
|
# The .org files will be appended here in the order specified in the
|
||||||
|
# table_of_contents file
|
||||||
|
|
||||||
|
@ -1,41 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
INPUT=$1
|
|
||||||
SRC=$PWD
|
|
||||||
|
|
||||||
|
|
||||||
# Install htmlize if needed
|
|
||||||
[[ -f ../docs/htmlize.el ]] || (
|
|
||||||
cd ../docs/
|
|
||||||
git clone https://github.com/hniksic/emacs-htmlize
|
|
||||||
cp emacs-htmlize/htmlize.el .
|
|
||||||
rm -rf emacs-htmlize
|
|
||||||
cd -
|
|
||||||
)
|
|
||||||
|
|
||||||
[[ -f ../docs/htmlize.el ]] || exit 1
|
|
||||||
|
|
||||||
|
|
||||||
# Switch to TMPDIR for easy cleanup
|
|
||||||
TMPDIR=$(mktemp -d)
|
|
||||||
./merge_org.sh $TMPDIR/$INPUT
|
|
||||||
cd $TMPDIR
|
|
||||||
|
|
||||||
|
|
||||||
# Create documentation
|
|
||||||
emacs --batch \
|
|
||||||
--load ${SRC}/../docs/htmlize.el \
|
|
||||||
--load ${SRC}/../toold/init.el \
|
|
||||||
$INPUT -f org-html-export-to-html
|
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]
|
|
||||||
then
|
|
||||||
rm -rf $TMPDIR
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
mv index.html ${SRC}/../docs/
|
|
||||||
rm -rf $TMPDIR
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
OUTPUT=$1
|
|
||||||
|
|
||||||
for i in README.org \
|
|
||||||
qmckl.org \
|
|
||||||
qmckl_context.org \
|
|
||||||
qmckl_error.org \
|
|
||||||
qmckl_precision.org \
|
|
||||||
qmckl_memory.org \
|
|
||||||
qmckl_distance.org \
|
|
||||||
qmckl_ao.org \
|
|
||||||
qmckl_footer.org \
|
|
||||||
test_qmckl.org
|
|
||||||
do
|
|
||||||
cat $i >> $1
|
|
||||||
done
|
|
9
src/table_of_contents
Normal file
9
src/table_of_contents
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
qmckl.org
|
||||||
|
qmckl_context.org
|
||||||
|
qmckl_error.org
|
||||||
|
qmckl_precision.org
|
||||||
|
qmckl_memory.org
|
||||||
|
qmckl_distance.org
|
||||||
|
qmckl_ao.org
|
||||||
|
test_qmckl.org
|
||||||
|
qmckl_footer.org
|
45
tools/create_doc.sh
Executable file
45
tools/create_doc.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
INPUT=merged.org
|
||||||
|
if [[ -z $QMCKL_ROOT ]]
|
||||||
|
then
|
||||||
|
print "QMCKL_ROOT is not defined"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# Install htmlize if needed
|
||||||
|
[[ -f ${QMCKL_ROOT}/docs/htmlize.el ]] || (
|
||||||
|
cd ${QMCKL_ROOT}/docs/
|
||||||
|
git clone https://github.com/hniksic/emacs-htmlize
|
||||||
|
cp emacs-htmlize/htmlize.el .
|
||||||
|
rm -rf emacs-htmlize
|
||||||
|
cd -
|
||||||
|
)
|
||||||
|
|
||||||
|
[[ -f ${QMCKL_ROOT}/docs/htmlize.el ]] || exit 1
|
||||||
|
|
||||||
|
|
||||||
|
# Switch to TMPDIR for easy cleanup
|
||||||
|
TMPDIR=$(mktemp -d)
|
||||||
|
${QMCKL_ROOT}/tools/merge_org.sh $TMPDIR/$INPUT
|
||||||
|
cd $TMPDIR
|
||||||
|
|
||||||
|
|
||||||
|
# Create documentation
|
||||||
|
emacs --batch \
|
||||||
|
--load ${QMCKL_ROOT}/docs/htmlize.el \
|
||||||
|
--load ${QMCKL_ROOT}/tools/init.el \
|
||||||
|
$INPUT -f org-html-export-to-html
|
||||||
|
|
||||||
|
if [[ $? -eq 0 ]]
|
||||||
|
then
|
||||||
|
rm -rf $TMPDIR
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
mv index.html ${QMCKL_ROOT}/docs/
|
||||||
|
rm -rf $TMPDIR
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
@ -1,17 +1,18 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
INPUT=$1
|
MERGED=merged.org
|
||||||
./merge_org.sh $INPUT
|
${QMCKL_ROOT}/tools/merge_org.sh $MERGED
|
||||||
|
|
||||||
OUTPUT=Makefile.generated
|
OUTPUT=Makefile.generated
|
||||||
|
|
||||||
# Tangle org files
|
# Tangle org files
|
||||||
emacs \
|
emacs \
|
||||||
$INPUT \
|
$MERGED \
|
||||||
--batch \
|
--batch \
|
||||||
-f org-babel-tangle \
|
-f org-babel-tangle \
|
||||||
--kill
|
--kill
|
||||||
|
|
||||||
|
rm $MERGED
|
||||||
|
|
||||||
|
|
||||||
# Create the list of *.o files to be created
|
# Create the list of *.o files to be created
|
8
tools/merge_org.sh
Executable file
8
tools/merge_org.sh
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
OUTPUT=$1
|
||||||
|
|
||||||
|
for i in README.org $(cat $QMCKL_ROOT/src/table_of_contents)
|
||||||
|
do
|
||||||
|
cat $i >> $1
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user