tPrepare structure for sister program with analytical solution - cngf-pf - continuum model for granular flows with pore-pressure dynamics (renamed from 1d_fd_simple_shear)
(HTM) git clone git://src.adamsgaard.dk/cngf-pf
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit eed6e94cd9af2c67920a537b5b2dd9fa41cf5378
(DIR) parent 657806c88cfce423b62f3386881c2ce52407f615
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 10 Dec 2019 20:18:45 +0100
Prepare structure for sister program with analytical solution
Diffstat:
R main.c -> 1d_fd_simple_shear.c | 0
M Makefile | 45 ++++++++++++++++++-------------
R main.c -> max_depth_simple_shear.c | 0
3 files changed, 26 insertions(+), 19 deletions(-)
---
(DIR) diff --git a/main.c b/1d_fd_simple_shear.c
(DIR) diff --git a/Makefile b/Makefile
t@@ -1,38 +1,45 @@
CFLAGS = -std=c99 -pedantic -Wall -O3
LDFLAGS = -lm
-SRC = arrays.c fluid.c main.c simulation.c
-OBJ = $(SRC:.c=.o)
HDR = arrays.h fluid.h parameter_defaults.h simulation.h
-BIN = ./1d_fd_simple_shear
+BIN = 1d_fd_simple_shear max_depth_simple_shear
PREFIX ?= /usr/local
INSTALL ?= install
STRIP ?= strip
-default: $(BIN)
+default: ${BIN}
-$(BIN): $(OBJ) $(HDR)
- $(CC) $(LDFLAGS) $(OBJ) -o $@
+.o:
+ ${CC} ${LDFLAGS} -o $@ ${LIBS}
-install: $(BIN)
- $(STRIP) $(BIN)
- $(INSTALL) -m 0755 -d $(DESTDIR)$(PREFIX)/bin
- $(INSTALL) -m 0755 $(BIN) $(DESTDIR)$(PREFIX)/bin
+.c.o:
+ ${CC} ${CFLAGS} -c $<
+
+1d_fd_simple_shear: 1d_fd_simple_shear.o arrays.o fluid.o simulation.o ${HDR}
+ ${CC} ${LDFLAGS} 1d_fd_simple_shear.o arrays.o fluid.o simulation.o -o $@
+
+max_depth_simple_shear: max_depth_simple_shear.o arrays.o fluid.o simulation.o ${HDR}
+ ${CC} ${LDFLAGS} max_depth_simple_shear.o arrays.o fluid.o simulation.o -o $@
+
+install: ${BIN}
+ ${STRIP} ${BIN}
+ ${INSTALL} -m 0755 -d ${DESTDIR}${PREFIX}/bin
+ ${INSTALL} -m 0755 ${BIN} ${DESTDIR}${PREFIX}/bin
uninstall:
- rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN)
+ rm -f ${DESTDIR}${PREFIX}/bin/${BIN}
watch:
- echo $(SRC) $(HDR) | tr ' ' '\n' | entr -s 'make && ./1d_fd_simple_shear'
+ echo ${SRC} ${HDR} | tr ' ' '\n' | entr -s 'make && ./1d_fd_simple_shear'
-test: $(BIN)
+test: ${BIN}
make -C test/
-memtest: $(BIN)
- valgrind --error-exitcode=1 --leak-check=full $(BIN) -h
- valgrind --error-exitcode=1 --leak-check=full $(BIN)
- valgrind --error-exitcode=1 --leak-check=full $(BIN) -F
- valgrind --error-exitcode=1 --leak-check=full $(BIN) -F \
+memtest: 1d_fd_simple_shear
+ valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear -h
+ valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear
+ valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear -F
+ valgrind --error-exitcode=1 --leak-check=full 1d_fd_simple_shear -F \
--fluid-pressure-top 50e3 \
--fluid-pressure-ampl 50e3 \
--fluid-pressure-freq $(echo "1/3600" | bc -l) \
t@@ -41,6 +48,6 @@ memtest: $(BIN)
clean:
rm -f *.txt
rm -f *.o
- rm -f 1d_fd_simple_shear
+ rm -f ${BIN}
.PHONY: default install uninstall watch test memtest clean
(DIR) diff --git a/main.c b/max_depth_simple_shear.c