tModularize make targets. - werner - cellular automata simulation of wind-driven sand transport
 (HTM) git clone git://src.adamsgaard.dk/werner
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 909d3797ce6ac549533dff17e9caa531bbaec810
 (DIR) parent 4eb3f9739ae039ceca97338ee17884d671cc8753
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Wed, 18 Aug 2021 16:48:59 +0200
       
       Modularize make targets.
       
       Diffstat:
         M Makefile                            |      16 ++++++++++++++--
         M out/matrix.010.txt.png              |       0 
         M out/matrix.050.txt.png              |       0 
         M out/matrix.300.txt.png              |       0 
       
       4 files changed, 14 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/Makefile b/Makefile
       t@@ -2,7 +2,7 @@ CFLAGS=-g -Wall -O3 -std=gnu11 -pg
        LDLIBS=`pkg-config --libs gsl`
        LDFLAGS=-pg
        
       -default: plots
       +default: build
        
        initrnd: initrnd.o werner.o *.h
        
       t@@ -10,16 +10,28 @@ iterate: iterate.o werner.o *.h
        
        printmat: printmat.o werner.o *.h
        
       +build: initrnd iterate printmat Makefile
       +        @printf "The executables have been built.\n"
       +        @printf "Further options:\n"
       +        @printf "\tmake plot - generate the plot data\n"
       +        @printf "\tmake view - show the separate plot pictures\n"
       +        @printf "\tmake movie - show the plot as animation\n"
       +        @printf "Have fun!\n"
       +
        display: matrix.png
                display $<
        
       -matrixes: initrnd iterate printmat Makefile
       +matrixes: build
                ./initrnd > tmp.mat
                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
        
        plots: matrixes
                cd out && for f in *.txt; do gnuplot -e "matrixfile='$$f'" plotmatrix.gp; done
        
       +movie: plots
       +        ffmpeg -i out/matrix.%03d.txt.png -framerate 15 out.mkv
       +        @printf "Now you can watch out.mkv.\n"
       +
        view: plots
                feh out/*.png
        
 (DIR) diff --git a/out/matrix.010.txt.png b/out/matrix.010.txt.png
       Binary files differ.
 (DIR) diff --git a/out/matrix.050.txt.png b/out/matrix.050.txt.png
       Binary files differ.
 (DIR) diff --git a/out/matrix.300.txt.png b/out/matrix.300.txt.png
       Binary files differ.