tFix main Makefile to use local binary and remove example targets - cngf-pf - c… | |
git clone git://src.adamsgaard.dk/cngf-pf | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit e29ffbfa4c1df312f3c1e3f59011e4c0efa4e68f | |
parent cb7836407f4ee917835b4b5c8104597e1c81b44a | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 28 Jun 2019 11:55:05 +0200 | |
Fix main Makefile to use local binary and remove example targets | |
Diffstat: | |
M Makefile | 107 ++---------------------------… | |
1 file changed, 6 insertions(+), 101 deletions(-) | |
--- | |
diff --git a/Makefile b/Makefile | |
t@@ -3,16 +3,17 @@ LDFLAGS = -lm | |
SRC = $(wildcard *.c) | |
OBJ = $(patsubst %.c,%.o,$(SRC)) | |
HDR = $(wildcard *.h) | |
-BIN = 1d_fd_simple_shear | |
+BIN = ./1d_fd_simple_shear | |
PREFIX ?= /usr/local | |
INSTALL ?= install | |
STRIP ?= strip | |
-.PHONY: default | |
default: $(BIN) | |
-.PHONY: install | |
+$(BIN): $(OBJ) $(HDR) | |
+ $(CC) $(LDFLAGS) $(OBJ) -o $@ | |
+ | |
install: $(BIN) | |
$(STRIP) $(BIN) | |
$(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin | |
t@@ -21,107 +22,9 @@ install: $(BIN) | |
uninstall: | |
$(RM) $(DESTDIR)$(PREFIX)/bin/$(BIN) | |
-.PHONY: plots | |
-plots: 1d_fd_simple_shear.png \ | |
- 1d_fd_simple_shear_rheology.png \ | |
- 1d_fd_simple_shear_rheology_kamb.png \ | |
- 1d_fd_simple_shear_rheology_iverson.png \ | |
- 1d_fd_simple_shear_rheology_tulaczyk.png \ | |
- diurnal.timeseries.pdf | |
- | |
-diurnal.mp4: diurnal.output00000.txt.png | |
- ffmpeg -i diurnal.output%05d.txt.png -y diurnal.mp4 | |
- | |
-diurnal.output00000.txt.png: 1d_fd_simple_shear_fluid.gp diurnal.output00000.t… | |
- /bin/sh -c '\ | |
- for f in diurnal.output*.txt; do \ | |
- gnuplot -e "filename=\"$$f\"; p_min=\"0\"; p_max=\"100e3\"" $<… | |
- done' | |
- | |
-diurnal.output00000.txt: 1d_fd_simple_shear | |
- /bin/sh -c '\ | |
- ./$< --resolution 50 --length 2.0 --normal-stress 150e3 --fluid --flui… | |
- | |
-diurnal.timeseries.txt: diurnal.output00000.txt | |
- /bin/sh -c '\ | |
- for f in diurnal.output*.txt; do \ | |
- tail -n 1 "$$f" | cut -f2- >> $@; \ | |
- done' | |
- | |
-diurnal.timeseries.pdf: diurnal.timeseries.gp diurnal.timeseries.txt | |
- gnuplot $< > $@ | |
- | |
-diurnal.gif: diurnal.mp4 | |
- convert diurnal.output*.txt.png \ | |
- -delay 1 -loop 0 -fuzz 10% -layers Optimize $@ | |
- | |
-1d_fd_simple_shear: $(OBJ) $(HDR) | |
- $(CC) $(LDFLAGS) $(OBJ) -o $@ | |
- | |
-1d_fd_simple_shear.png: 1d_fd_simple_shear 1d_fd_simple_shear.gp | |
- /bin/sh -c '\ | |
- for P in 10 20 40 60 80 120; do \ | |
- ./$< -o 0.03 -L 0.64 -P $${P}e3 -N > $<_P$${P}kPa.txt; \ | |
- done' | |
- gnuplot $<.gp > $@ | |
- | |
-1d_fd_simple_shear_rheology.png: 1d_fd_simple_shear 1d_fd_simple_shear_rheolog… | |
- /bin/sh -c '\ | |
- for b in $$(printf "0.01\n0.10\n"; seq 0.20 0.20 1.00); do \ | |
- out="$<_rheology_b$${b}.txt"; \ | |
- rm -f "$$out"; \ | |
- for t in $$(seq 0.01 0.01 0.8); do \ | |
- printf "$$t\t" >> "$$out"; \ | |
- ./$< -P 20e3 --stress-ratio $$t -b $$b | \ | |
- tail -n 1 | cut -f2 >> "$$out"; \ | |
- done; done' | |
- gnuplot $<_rheology.gp > $@ | |
- | |
-# 1 bar is equal to 100 kPa | |
-1d_fd_simple_shear_rheology_kamb.png: 1d_fd_simple_shear 1d_fd_simple_shear_rh… | |
- /bin/sh -c '\ | |
- for b in 0.01 0.10 0.20 0.40 0.94; do \ | |
- out="$<_rheology_b$${b}_kamb.txt"; \ | |
- rm -f "$$out"; \ | |
- for t in $$(seq 0.01 0.01 2.0); do \ | |
- printf "$$t\t" >> "$$out"; \ | |
- ./$< -f 1.1 -P 1.7e3 --stress-ratio $$t -b $$b | \ | |
- tail -n 1 | cut -f2 >> "$$out"; \ | |
- done; done' | |
- gnuplot $<_rheology_kamb.gp > $@ | |
- | |
-# shear-strain rate from 10^1 to 10^6 m/a | |
-# friction around 0.55 | |
-1d_fd_simple_shear_rheology_iverson.png: 1d_fd_simple_shear 1d_fd_simple_shear… | |
- /bin/sh -c '\ | |
- for b in $$(printf "0.01\n0.10\n"; seq 0.20 0.20 0.90) 0.94; do \ | |
- out="$<_rheology_b$${b}_iverson.txt"; \ | |
- rm -f "$$out"; \ | |
- for t in $$(seq 0.0001 0.002 1.0); do \ | |
- printf "$$t\t" >> "$$out"; \ | |
- ./$< -f 0.55 -P 100e3 -L 1.0 --stress-ratio $$t -b $$b… | |
- tail -n 1 | cut -f2 >> "$$out"; \ | |
- done; done' | |
- gnuplot $<_rheology_iverson.gp > $@ | |
- | |
-# shear velocity rate from 0.1 m/h to 100 m/h | |
-1d_fd_simple_shear_rheology_tulaczyk.png: 1d_fd_simple_shear 1d_fd_simple_shea… | |
- /bin/sh -c '\ | |
- for b in $$(printf "0.01\n0.10\n"; seq 0.20 0.20 1.00) 0.94; do \ | |
- out="$<_rheology_b$${b}_tulaczyk.txt"; \ | |
- rm -f "$$out"; \ | |
- for t in $$(seq 0.1 0.002 0.9); do \ | |
- printf "$$t\t" >> "$$out"; \ | |
- ./$< -f 0.5 -P 10e3 --stress-ratio $$t -b $$b | \ | |
- tail -n 1 | cut -f2 >> "$$out"; \ | |
- done; done' | |
- gnuplot $<_rheology_tulaczyk.gp > $@ | |
- | |
-.PHONY: watch | |
watch: | |
echo $(SRC) $(HDR) | tr ' ' '\n' | entr -s 'make && ./1d_fd_simple_she… | |
-.PHONY: memtest | |
memtest: $(BIN) | |
valgrind --error-exitcode=1 --leak-check=full $(BIN) -h | |
valgrind --error-exitcode=1 --leak-check=full $(BIN) | |
t@@ -133,3 +36,5 @@ clean: | |
$(RM) 1d_fd_simple_shear | |
$(RM) 1d_fd_simple_shear.png | |
$(RM) 1d_fd_simple_shear_rheology*.png | |
+ | |
+.PHONY: default install uninstall watch memtest clean |