aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorjustanothercatgirl <sotov@twistea.su>2024-12-06 15:08:31 +0300
committerjustanothercatgirl <sotov@twistea.su>2024-12-06 15:08:31 +0300
commita470c304199866aa1f3d39ff22ec30734f03d617 (patch)
treeb08858e91b39fc108f2ab9b83c03ef7f881711ba /Makefile
parent24b8430fa7a9a81b88c5c172c99bbc9a520ff4ba (diff)
сделал 8 задание))))task8
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