-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (49 loc) · 1.64 KB
/
Makefile
File metadata and controls
57 lines (49 loc) · 1.64 KB
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
PYBFMS_DOC:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
PACKAGES_DIR:=$(PYBFMS_DOC)/packages
PYTHON:=$(PACKAGES_DIR)/python/bin/python3
SPHINXBUILD:=$(PACKAGES_DIR)/python/bin/sphinx-build
SPHINXOPTS=
BFMS += pybfms_wishbone pybfms_riscv_debug
all : update
link :
rm -rf $(PYBFMS_DOC)/doc/source/bfms
rm -rf $(PYBFMS_DOC)/doc/source/pybfms
ln -s $(PYBFMS_DOC)/doc/source/pybfms $(PACKAGES_DIR)/pybfms
mkdir -p $(PYBFMS_DOC)/doc/source/bfms
for bfm in $(BFMS); do \
cp -r $(PACKAGES_DIR)/$$bfm $(PYBFMS_DOC)/doc/source/bfms ; \
rm -rf $(PYBFMS_DOC)/doc/bfms/$$bfm/.git ; \
done
update :
rm -rf $(PYBFMS_DOC)/doc/source/bfms
rm -rf $(PYBFMS_DOC)/doc/source/pybfms
mkdir $(PYBFMS_DOC)/doc/source/pybfms
cp -r $(PACKAGES_DIR)/pybfms/doc $(PACKAGES_DIR)/pybfms/src $(PYBFMS_DOC)/doc/source/pybfms
mkdir -p $(PYBFMS_DOC)/doc/source/bfms
for bfm in $(BFMS); do \
mkdir $(PYBFMS_DOC)/doc/source/bfms/$$bfm ; \
cp -r $(PACKAGES_DIR)/$$bfm/doc $(PACKAGES_DIR)/$$bfm/src $(PYBFMS_DOC)/doc/source/bfms/$$bfm ; \
done
push :
deleted=`git status | grep deleted | sed -e 's/deleted://g' | wc -l`; \
if test $$deleted -ne 0; then \
git rm `git status | grep deleted | sed -e 's/deleted://g'`; \
fi
git add doc
git status
no_changes=`git status | grep 'no changes added' | wc -l`; \
if test $$no_changes -eq 0; then \
echo "Changes detected"; \
git commit -m "Update @ `date +%Y%m%d_%H%M`"; \
git push; \
else \
echo "No changes committed"; \
fi
latex latexpdf html :
rm -rf $(PYBFMS_DOC)/build
mkdir -p $(PYBFMS_DOC)/build
$(SPHINXBUILD) \
-M $@ \
"$(PYBFMS_DOC)/doc/source" \
"$(PYBFMS_DOC)/build" \
$(SPHINXOPTS)