aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 993582cca81bdeab3657b3ed8ec649f3450e907f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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