forked from jfbercher/LecturesSignalProcessing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
105 lines (81 loc) · 3.3 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
SHELL := /bin/bash
#--> original source file in main directory
#IPYNB= $(wildcard *.ipynb)
#this is to get the list of basenames dependencies in a subdir
IPYNB= $(notdir $(wildcard src/*.ipynb)) #$(shell ls -1 src/*.ipynb |xargs -n1 basename)
#
HTML= $(IPYNB:.ipynb=.html)
SUBDIR_HTML = $(foreach I,$(HTML),html/$I)
#alternatively:
#SUBDIR_HTML = $(addprefix html/,$(HTML))
TEX= $(IPYNB:.ipynb=.tex)
SUBDIR_TEX = $(foreach I,$(TEX),tex/$I)
SUBDIR_exec = $(foreach I,$(IPYNB),exec/$I)
here=$(CURDIR)
#/home/bercherj/JFB/tstmake
a:
echo $(IPYNB)
rien: $(IPYNB)
echo $(IPYNB2)
echo $(CURDIR)
html: $(SUBDIR_exec) $(SUBDIR_HTML)
#jupyter nbconvert --to html $(IPYNB)
#echo "$(SUBDIR_HTML)"
#to convert ipynb in current directory to html in sub html/
html/%.html: exec/%.ipynb
echo "Executing jupyter nbconvert --to html $^"
#jupyter nbconvert --to html exec/$(basename $(notdir $^)).ipynb --output html/$(basename $(notdir $^)).html
./conversion/conv_ipynb_to_html $^
mv exec/$*.html html/
tex: exec $(SUBDIR_TEX)
#to convert ipynb in current directory to html in sub html/
#html/%.html: %.ipynb
# echo "Executing jupyter nbconvert --to html $^"
# #jupyter nbconvert --quiet --to html $^
# ./conversion/conv_ipynb_to_html $^
# mv $*.html html/
altsrc:
rsync -a src/ exec/ --exclude=*.ipynb
# Convert notebooks in src into an executable version in subdir exec
exec/%.ipynb: src/%.ipynb
echo "Executing jupyter nbconvert exec $^"
jupyter nbconvert --execute --allow-errors --to notebook $^ --output exec/$(notdir $^)
exec: altsrc $(SUBDIR_exec)
#to convert ipynb in ipynb directory to html in sub html/
html/%.html: ipynb/%.ipynb
echo "Executing jupyter nbconvert --to html $^"
jupyter nbconvert --quiet --to html $^
mv $*.html html/
tex/%.tex: exec/%.ipynb
echo "Executing jupyter nbconvert --to latex $^"
cp $^ tex/
cd tex/ && \
echo "Executing jupyter $(here)/conversion/ipynb_thms_to_latex $(notdir $^)" && \
$(here)/conversion/ipynb_thms_to_latex $(notdir $^) #&&\
cd ..
rm tex/$(notdir $^)
pdf: tex
cd tex && \
xelatex -interaction=nonstopmode Poly.tex &> /dev/null | cat && \
xelatex -interaction=nonstopmode Poly.tex &> /dev/null | cat
zip: html
rm -f LecturesSignalProcessing.zip
zip -9 -r LecturesSignalProcessing src/
zip -9 -r LecturesSignalProcessing html/
zip -9 -r LecturesSignalProcessing tex/*.pdf
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/LecturesSignalProcessing.zip [email protected]:public_html/
all: tex html pdf
cp *.css html/ 2>/dev/null | cat && \
cp *.png html/ 2>/dev/null | cat
git: all
git add .
git commit -m "update `date +'%y.%m.%d %H:%M:%S'`"
git push
sync: all
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/html/*.css [email protected]:public_html/IT3007
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/html/*.html [email protected]:public_html/IT3007
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/*.ipynb [email protected]:public_html/IT3007
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/tex/*.pdf [email protected]:public_html/IT3007
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/*.png [email protected]:public_html/IT3007
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/*.zip [email protected]:public_html/IT3007
rsync -av --chmod=755 -e "ssh -p 52222" $(here)/install* [email protected]:public_html/IT3007