-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (27 loc) · 1.02 KB
/
Makefile
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
38
39
40
NASM = nasm
ASMFLAGS += -g -f elf32
CFLAGS ?= -O2 -g
CFLAGS += -std=gnu99
CFLAGS += -Wall -Werror -Wformat-security -Wignored-qualifiers -Winit-self \
-Wswitch-default -Wpointer-arith -Wtype-limits -Wempty-body \
-Wstrict-prototypes -Wold-style-declaration -Wold-style-definition \
-Wmissing-parameter-type -Wmissing-field-initializers -Wnested-externs \
-Wstack-usage=4096 -Wmissing-prototypes -Wfloat-equal -Wabsolute-value
CFLAGS += -fsanitize=undefined -fsanitize-undefined-trap-on-error
CC += -m32 -no-pie -fno-pie
LDLIBS = -lm
.PHONY: all clean test
all: integral
integral: integral.c funcs.o
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
funcs.o: funcs.asm
$(NASM) $(ASMFLAGS) $< -o $@
test: all
./integral --test-root 4:5:0.5:2:0.0000001:1.105
./integral --test-root 4:6:0.8:1.3:0.0000001:1.141
./integral --test-root 5:6:0.6:1.2:0.0000001:1.000000
./integral --test-integral 4:-1.5:2:0.00001:13.708333
./integral --test-integral 5:1:2:0.00001:7.833333
./integral --test-integral 6:0.5:3:0.00001:53.59375
clean:
rm -rf *.o