tMakefile - werner - cellular automata simulation of wind-driven sand transport
HTML git clone git://src.adamsgaard.dk/werner
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tMakefile (1280B)
---
1 CFLAGS=-g -Wall -O3 -std=gnu11 -pg
2 LDLIBS=`pkg-config --libs gsl`
3 LDFLAGS=-pg
4
5 default: build
6
7 initrnd: initrnd.o werner.o *.h
8
9 iterate: iterate.o werner.o *.h
10
11 printmat: printmat.o werner.o *.h
12
13 build: initrnd iterate printmat Makefile
14 @printf "The executables have been built.\n"
15 @printf "Further options:\n"
16 @printf "\tmake plots - generate the plot data\n"
17 @printf "\tmake view - show the separate plot pictures\n"
18 @printf "\tmake movie - show the plot as animation\n"
19 @printf "Have fun!\n"
20
21 display: matrix.png
22 display $<
23
24 matrixes: build
25 ./initrnd > tmp.mat
26 for i in {001..400}; do cat tmp.mat | ./iterate 1 > tmp_new.mat && cat tmp_new.mat | ./printmat > out/matrix.$$i.txt && mv tmp_new.mat tmp.mat; done
27
28 plots: matrixes
29 cd out && for f in *.txt; do gnuplot -e "matrixfile='$$f'" plotmatrix.gp; done
30
31 movie: plots
32 if [ -n "${BRITISH}" ]; \
33 then \
34 ffmpeg -i out/matrix.%03d.txt.png -i rule-britannia-audio.ogg -framerate 15 out.mkv; \
35 else \
36 ffmpeg -i out/matrix.%03d.txt.png -framerate 15 out.mkv; \
37 fi
38 @printf "Now you can watch out.mkv.\n"
39
40 view: plots
41 feh out/*.png
42
43 profile-iter: initrnd iterate
44 ./initrnd > tmp.mat
45 ./iterate 10 > tmp_new.mat
46
47 clean:
48 $(RM) initrnd iterate printmat
49 $(RM) *.o
50 $(RM) tmp.mat
51 $(RM) out/*.txt
52 $(RM) out/*.png