commit bdd98a914e10b2127617c196f8a9ae126c38c5da
parent efc11cbdf7cfe37f81783b757c4b9d36fa1240a5
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 21 Nov 2019 15:21:05 +0100
Use POSIX make in all remaining makefiles
Diffstat:
6 files changed, 29 insertions(+), 32 deletions(-)
diff --git a/Makefile b/Makefile
@@ -49,5 +49,6 @@ $(REPO)/Makefile:
clean:
make -C $(REPO)/ clean
rm -f fig*.pdf
+ for d in $(FIGDIRS); do make -C $$d/ clean; done
.PHONY: default figures clean
diff --git a/fig-parameter_test/Makefile b/fig-parameter_test/Makefile
@@ -1,5 +1,5 @@
BIN = ../1d_fd_simple_shear/1d_fd_simple_shear
-FIG := $(shell basename $(CURDIR))
+FIG != basename $(PWD)
# default parameter values
LENGTH = 1.0
@@ -18,7 +18,7 @@ d.txt: $(BIN)
rm -rf $@; \
for d in 1e-4 2e-4 4e-4 1e-3 2e-3 4e-3 1e-2 2e-2; do \
printf "$$d\t" >> $@; \
- ./$< \
+ ./$(BIN) \
--length $(LENGTH) \
--set-shear-velocity $(SHEAR_VEL) \
--normal-stress $(NORMAL_STRESS) \
@@ -36,7 +36,7 @@ mu_s.txt: $(BIN)
rm -rf $@; \
for mu_s in $$(seq 0.20 0.05 0.70); do \
printf "$$mu_s\t" >> $@; \
- ./$< \
+ ./$(BIN) \
--length $(LENGTH) \
--set-shear-velocity $(SHEAR_VEL) \
--normal-stress $(NORMAL_STRESS) \
@@ -54,7 +54,7 @@ C.txt: $(BIN)
rm -rf $@; \
for C in 0.0 5e3 10e3 15e3 20e3 25e3 30e3; do \
printf "$$C\t" >> $@; \
- ./$< \
+ ./$(BIN) \
--length $(LENGTH) \
--set-shear-velocity $(SHEAR_VEL) \
--normal-stress $(NORMAL_STRESS) \
@@ -72,7 +72,7 @@ A.txt: $(BIN)
rm -rf $@; \
for A in 1e-10 $$(seq 0.1 0.10 1.00); do \
printf "$$A\t" >> $@; \
- ./$< \
+ ./$(BIN) \
--length $(LENGTH) \
--set-shear-velocity $(SHEAR_VEL) \
--normal-stress $(NORMAL_STRESS) \
@@ -90,7 +90,7 @@ b.txt: $(BIN)
rm -rf $@; \
for b in $$(seq 0.1 0.1 0.9); do \
printf "$$b\t" >> $@; \
- ./$< \
+ ./$(BIN) \
--length $(LENGTH) \
--set-shear-velocity $(SHEAR_VEL) \
--normal-stress $(NORMAL_STRESS) \
@@ -108,7 +108,7 @@ L_z.txt: $(BIN)
rm -rf $@; \
for L_z in 0.002 0.004 0.008 0.01 0.015 0.02 0.04 0.06 0.08 0.10 0.15 0.20 0.25 0.30 0.40 0.50 0.60 0.70 0.75 0.80 0.90 1.0; do \
printf "$$L_z\t" >> $@; \
- ./$< \
+ ./$(BIN) \
--length $$L_z \
--set-shear-velocity $(SHEAR_VEL) \
--normal-stress $(NORMAL_STRESS) \
@@ -123,10 +123,10 @@ L_z.txt: $(BIN)
../$(FIG).pdf: fig.gp d.txt mu_s.txt C.txt A.txt b.txt L_z.txt
- gnuplot $< > $@
+ gnuplot fig.gp > $@
clean:
- $(RM) *.txt
- $(RM) ../$(FIG).pdf
+ rm -f *.txt
+ rm -f ../$(FIG).pdf
.PHONY: default clean
diff --git a/fig-pulse_square/Makefile b/fig-pulse_square/Makefile
@@ -1,15 +1,13 @@
BIN = ../1d_fd_simple_shear/1d_fd_simple_shear
-FIG = $(shell basename $(CURDIR))
+FIG != basename $(PWD)
default: ../$(FIG).pdf
PF_SEQ=1 2 3 4 5 6 7 8 9
-# --stress-ratio 0.40 \
-
sim-4.output00000.txt: $(BIN) Makefile
/bin/sh -c 'for i in $(PF_SEQ); do \
- ./$< --length 8.0 \
+ ./$(BIN) --length 8.0 \
--normal-stress 200e3 \
--set-shear-velocity $$( echo "10000/(365*24*60*60)" | bc -l ) \
--fluid \
@@ -52,10 +50,10 @@ max_strainrate_depth.txt: sim-4.output00000.txt
done; done'
../$(FIG).pdf: fig.gp timeseries.txt max_strainrate_depth.txt
- gnuplot $< > $@
+ gnuplot fig.gp > $@
clean:
- $(RM) *.txt
- $(RM) ../$(FIG).pdf
+ rm -f *.txt
+ rm -f ../$(FIG).pdf
.PHONY: default clean
diff --git a/fig-pulse_triangle/Makefile b/fig-pulse_triangle/Makefile
@@ -1,15 +1,13 @@
BIN = ../1d_fd_simple_shear/1d_fd_simple_shear
-FIG = $(shell basename $(CURDIR))
+FIG != basename $(PWD)
default: ../$(FIG).pdf
PF_SEQ=1 2 3 4 5 6 7 8 9
-# --stress-ratio 0.40 \
-
sim-4.output00000.txt: $(BIN) Makefile
/bin/sh -c 'for i in $(PF_SEQ); do \
- ./$< --length 8.0 \
+ ./$(BIN) --length 8.0 \
--normal-stress 200e3 \
--set-shear-velocity $$( echo "10000/(365*24*60*60)" | bc -l ) \
--fluid \
@@ -52,10 +50,10 @@ max_strainrate_depth.txt: sim-4.output00000.txt
done; done'
../$(FIG).pdf: fig.gp timeseries.txt max_strainrate_depth.txt
- gnuplot $< > $@
+ gnuplot fig.gp > $@
clean:
- $(RM) *.txt
- $(RM) ../$(FIG).pdf
+ rm -f *.txt
+ rm -f ../$(FIG).pdf
.PHONY: default clean
diff --git a/fig-skin_depth/Makefile b/fig-skin_depth/Makefile
@@ -1,11 +1,11 @@
-FIG = $(shell basename $(CURDIR))
+FIG != basename $(PWD)
default: ../$(FIG).pdf
../$(FIG).pdf: fig.gp
- gnuplot $< > $@
+ gnuplot fig.gp > $@
clean:
- $(RM) ../$(FIG).pdf
+ rm -f ../$(FIG).pdf
.PHONY: default clean
diff --git a/fig-stick_slip_rate_depth/Makefile b/fig-stick_slip_rate_depth/Makefile
@@ -1,10 +1,10 @@
BIN = ../1d_fd_simple_shear/1d_fd_simple_shear
-FIG = $(shell basename $(CURDIR))
+FIG != basename $(PWD)
default: ../$(FIG).pdf
sim.output00000.txt: $(BIN) Makefile ../skindepth.gp
- ./$< \
+ ./$(BIN) \
--length 8.0 \
--set-shear-velocity $$(echo "1000/(365*24*60*60)" | bc -l) \
--normal-stress 200e3 \
@@ -17,10 +17,10 @@ sim.output00000.txt: $(BIN) Makefile ../skindepth.gp
--time-end $$(echo "3600*24*3 + 3600" | bc -l) sim
../$(FIG).pdf: fig.gp sim.output00000.txt
- gnuplot $< > $@
+ gnuplot fig.gp > $@
clean:
- $(RM) *.txt
- $(RM) ../$(FIG).pdf
+ rm -f *.txt
+ rm -f ../$(FIG).pdf
.PHONY: default clean