commit 507e1e81596ab25729f4c822ff9a7c7d183c61a6 parent f463d4d2404fe59625621e49a7db22b70a9202d4 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Fri, 5 Apr 2019 14:53:44 +0200 Fix Makefile compilation and linking Diffstat:
M | Makefile | | | 25 | ++++++++++++++++++------- |
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile @@ -1,12 +1,23 @@ CFLAGS=-g -std=c99 -pedantic -Wall LDFLAGS=-lm -JULIA=julia --banner=no --color=yes +SRC=$(wildcard *.c) +OBJ=$(patsubst %.c,%.o,$(SRC)) +HDR=$(wildcard *.h) -.PHONY: run-julia -run-julia: 1d_fd_simple_shear.jl - echo "$<" | entr -s '$(JULIA) "$<"' +default: 1d_fd_simple_shear -1d_fd_simple_shear.png: 1d_fd_simple_shear.jl - $(JULIA) $< +# JULIA=julia --banner=no --color=yes +# .PHONY: run-julia +# run-julia: 1d_fd_simple_shear.jl +# echo "$<" | entr -s '$(JULIA) "$<"' +# +# 1d_fd_simple_shear.png: 1d_fd_simple_shear.jl +# $(JULIA) $< -1d_fd_simple_shear: 1d_fd_simple_shear.c arrays.c +1d_fd_simple_shear: $(OBJ) $(HDR) + $(CC) $(LDFLAGS) $(OBJ) -o $@ + +clean: + $(RM) *.png + $(RM) *.o + $(RM) 1d_fd_simple_shear