Advertisement
_takumi

hw6_makefile

Nov 8th, 2022
2,000
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 1.06 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 1:2:1.9:2:0.0000001:1.956152
  33.     ./integral --test-root 1:3:-0.3:-0.2:0.0000001:-0.203334
  34.     ./integral --test-root 2:3:0.1:0.2:0.0000001:0.187411
  35.     ./integral --test-integral 1:0:2:0.00001:4.712388
  36.     ./integral --test-integral 2:0:2:0.00001:2.399529
  37.     ./integral --test-integral 3:0:2:0.00001:0.864664
  38.  
  39. clean:
  40.     rm -rf *.o
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement