Advertisement
somya-kr

makefile

Aug 18th, 2024
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CMake 1.30 KB | None | 0 0
  1. # Compiler and flags
  2. CC = gcc
  3. CFLAGS = -g -O2 -Wall -I/usr/include/lua5.4
  4. LDFLAGS = -llua5.4
  5.  
  6. # Source files
  7. SRCS = fullgc.c incrementalgc.c generationalgc.c
  8.  
  9. # convert dot files to png
  10. pngs: dotfiles
  11.     dot -Tpng fullgc.dot -o fullgc.png
  12.     dot -Tpng incrementalgc.dot -o incrementalgc.png
  13.     dot -Tpng generationalgc.dot -o generationalgc.png
  14.  
  15.  
  16. # convert callgrind output to dotfile
  17. dotfiles: callgrind
  18.     . env/bin/activate
  19.     gprof2dot -f callgrind fullgc.txt -o fullgc.dot
  20.     gprof2dot -f callgrind incrementalgc.txt -o incrementalgc.dot
  21.     gprof2dot -f callgrind generationalgc.txt -o generationalgc.dot
  22.  
  23.  
  24. # Run each executable
  25. callgrind: fullgc incrementalgc generationalgc
  26.     valgrind --tool=callgrind --callgrind-out-file=fullgc.txt  ./fullgc
  27.     valgrind --tool=callgrind --callgrind-out-file=incrementalgc.txt ./incrementalgc
  28.     valgrind --tool=callgrind --callgrind-out-file=generationalgc.txt ./generationalgc
  29.     clear
  30.  
  31.  
  32. # Compile each source file into an executable
  33. fullgc: fullgc.c
  34.     $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
  35.     clear
  36.  
  37. incrementalgc: incrementalgc.c
  38.     $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
  39.     clear  
  40.  
  41. generationalgc: generationalgc.c
  42.     $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
  43.     clear
  44.  
  45. # Clean up
  46. clean:
  47.     rm -f fullgc incrementalgc generationalgc *.dot *.txt
  48.     clear
  49.  
  50. .PHONY: all clean callgrind
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement