File: Makefile

package info (click to toggle)
casadi 3.7.0%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,964 kB
  • sloc: cpp: 114,229; python: 35,462; xml: 1,946; ansic: 859; makefile: 257; sh: 114; f90: 63; perl: 9
file content (33 lines) | stat: -rw-r--r-- 794 bytes parent folder | download
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
PY=$(shell find -name "*.py"  -not -name "_temp.py" -not -name "*ctemplate*")
CPP=$(shell find -name "*.cc" -not -name "_temp.cc" -not -name "*ctemplate*")
EXE=$(CPP:.cc=.run)
LOG=$(CPP:.cc=.log)
PDF=$(PY:.py=.pdf)
BUILDDIR=../../../build

OCTAVE_PATH=$(BUILDDIR)/lib
all: cpp cpprun python

.PHONY = python cpp cpprun

python: $(PDF)
cpp: $(EXE)
cpprun: $(LOG)

clean: 
	rm -f _temp.* $(PDF) $(EXE)

$(PDF): %.pdf : %.py
	rm -rf pylab.py pylab.pyc matplotlibrc
	jupytext --to notebook $<
	jupyter nbconvert --to pdf --execute $(<:.py=.ipynb)
	#rm $(<:.py=.ipynb)
	
$(EXE): %.run : %.cc ctemplate/compiler.sh
	ctemplate/compiler.sh $< $@
	
$(LOG): %.log : %.run
	$< > $@ 2>&1
	
ctemplate/compiler.sh: ctemplate/ctemplate.py
	cd ctemplate && python ctemplate.py && chmod +x compiler.sh && cd ..