-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
62 lines (50 loc) · 1.61 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
TOPDIR=.
ifndef SRCDIR
SRCDIR=$(shell pwd)
endif
include $(TOPDIR)/CONFIG
SUBDIRS = utilities src
ALLSUBDIRS = $(SUBDIRS) doc bin
default::
for dir in $(SUBDIRS); \
do \
(cd $${dir} && $(MAKE) $(JOBS)) || exit 1; \
done
doc::
cd $(TOPDIR)/doc && doxygen Doxyfile
install:: bin/lowdin bin/lowdin.x
mkdir -p $(PREFIX)/.lowdin2
cp -rf $(TOPDIR)/bin/lowdinvars.sh $(TOPDIR)
$(SED) -i 's|PREFIX|$(PREFIX)|g' $(TOPDIR)/lowdinvars.sh
$(SED) -i 's|SCRATCH_DIR|$(SCRATCH)|g' $(TOPDIR)/lowdinvars.sh
$(SED) -i "s|COMMIT_ID|$(shell git --no-pager log -1 --pretty=format:"%H")|g" $(TOPDIR)/lowdinvars.sh
$(SED) -i 's|COMPILATION_DATE|$(shell date)|g' $(TOPDIR)/lowdinvars.sh
cp -rf $(TOPDIR)/lowdinvars.sh $(PREFIX)/.lowdin2/
cp -rf lib $(PREFIX)/.lowdin2/
mkdir -p $(PREFIX)/.lowdin2/bin
cp -rf $(TOPDIR)/bin/*.x $(PREFIX)/.lowdin2/bin
cp -rf $(TOPDIR)/bin/lowdin $(TOPDIR)
$(SED) -i 's|PREFIX|$(PREFIX)|g' $(TOPDIR)/lowdin
cp -rf $(TOPDIR)/lowdin $(PREFIX)/lowdin2
rm -rf $(TOPDIR)/lowdin
rm -rf $(TOPDIR)/lowdinvars.sh
uninstall:: bin/lowdin bin/lowdin.x
rm -rf $(PREFIX)/.lowdin2
rm -rf $(PREFIX)/lowdin2
clean::
for dir in $(SUBDIRS); \
do \
(cd $${dir} && $(MAKE) $(DODEPENDOPT) clean) || exit 1; \
done
distclean::
find . -name "*.o" -exec rm -f {} \;
find . -name "*.mod" -exec rm -f {} \;
find . -name "*~" -exec rm -f {} \;
find . -name "*.x" -exec rm -f {} \;
find . -name "*.a" -exec rm -f {} \;
find . -name "*.i90" -exec rm -f {} \;
find . -name "*.i" -exec rm -f {} \;
rm -rf $(TOPDIR)/doc/html
rm -rf $(TOPDIR)/doc/latex
test::
cd $(TOPDIR)/test/ && sh runtest.sh lowdin2