aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..993582c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+
+CFLAGS += -std=c89 -g -ggdb -Iinclude
+TASK_ARGS += -t 0.1
+
+.PHONY: clean all euler rk4 run tests
+
+all:
+ echo "either make euler or make rk4"
+
+euler: task8
+ ./$< $(TASK_ARGS) -m euler
+
+rk4: task8
+ ./$< $(TASK_ARGS) -m rk4
+
+tests: task8 check
+ ./check f1.data f2.data f3.data f4.data out.data
+ echo "plot 'out.data' with lines" | gnuplot - -p
+ echo "plot 'f1.data','f2.data','f3.data','f4.data'" | gnuplot - -p
+
+run: task8
+ ./$< $(TASK_ARGS)
+
+build:
+ mkdir -p build
+
+build/%.o: src/%.c include/%.h build
+ $(CC) -c -o $@ $(CFLAGS) $< -lm
+
+task8: main.c build/diffeq.o build/equations.o
+ $(CC) -o $@ $(CFLAGS) $^ -lm
+
+check: check.c
+ $(CC) -o check $(CFLAGS) check.c -lm
+
+clean:
+ $(RM) *.o task8 check build/* *.data