_takumi

Makefile

Jun 19th, 2022 (edited)
1,132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.05 KB | None | 0 0
  1. NASM = nasm
  2.  
  3. ASMFLAGS += -g -f elf32
  4.  
  5. CFLAGS ?= -O2 -g
  6.  
  7. CFLAGS += -std=gnu99
  8.  
  9. CFLAGS += -Wall -Werror -Wformat-security -Wignored-qualifiers -Winit-self \
  10. -Wswitch-default -Wpointer-arith -Wtype-limits -Wempty-body \
  11. -Wstrict-prototypes -Wold-style-declaration -Wold-style-definition \
  12. -Wmissing-parameter-type -Wmissing-field-initializers -Wnested-externs \
  13. -Wstack-usage=4096 -Wmissing-prototypes -Wfloat-equal -Wabsolute-value
  14.  
  15. CFLAGS += -fsanitize=undefined -fsanitize-undefined-trap-on-error
  16.  
  17. CC += -m32 -no-pie -fno-pie
  18.  
  19. LDLIBS = -lm
  20.  
  21. .PHONY: all clean test
  22.  
  23. all: integral
  24.  
  25. integral: integral.c funcs.o
  26.     $(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
  27.  
  28. funcs.o: funcs.asm
  29.     $(NASM) $(ASMFLAGS) $< -o $@
  30.  
  31. test: all
  32.     ./integral --test-root 4:5:0:3:0.0000001:1.000000
  33.     ./integral --test-root 4:6:1:4:0.0000001:2.000000
  34.     ./integral --test-root 5:6:0:1:0.0000001:0.5
  35.     ./integral --test-integral 4:-2:2:0.00001:10.666666
  36.     ./integral --test-integral 6:-0.5:2:0.00001:6.250000
  37.     ./integral --test-integral 7:0.5:3:0.00001:20.234375
  38.  
  39. clean:
  40.     rm -rf *.o
Add Comment
Please, Sign In to add comment