This contains my bachelors thesis and associated tex files, code snippets and maybe more. Topic: Data Movement in Heterogeneous Memories with Intel Data Streaming Accelerator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
4.6 KiB

  1. #####################################################################
  2. # This Makefile is part of a skeleton (diploma) thesis. If you have
  3. # useful additions, suggestions or questions, please feel free to issue a
  4. # PR or an issue at https://github.com/TUD-OS/latex-template
  5. ######################################################################
  6. # main document
  7. DOC_TEX = bachelor.tex
  8. # sub documents (chapters) without preamble
  9. # (because we do not need checkbiw on the preamble).
  10. DOC_TEX_ADD = $(wildcard content/*.tex)
  11. # All Tex-files sorted alphabetically and concatenated to a single string.
  12. # (make's shell utility converts newlines to spaces)
  13. # This makes the "checkbiw"-script more convenient.
  14. DOC_TEX_ALL_SORTED = $(shell echo $(DOC_TEX) $(DOC_TEX_ADD) | tr ' ' '\n' | sort)
  15. DOC_PDF = $(DOC_TEX:.tex=.pdf)
  16. LATEXMK = latexmk
  17. # Add "-shell-escape" when you use "minted" instead of "listings" for beautiful code listings
  18. LATEXMK_COMMON_FLAGS = -pdf -use-make
  19. LATEXMK_FLAGS = $(LATEXMK_COMMON_FLAGS) -pdflatex=lualatex -halt-on-error
  20. LATEXMK_WATCH_FLAGS = $(LATEXMK_COMMON_FLAGS) -pvc -quiet -f -pdflatex="lualatex -synctex=1 -interaction=nonstopmode"
  21. DATE := $(shell date +\"%Y-%m-%d_%H%M%S\")
  22. BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
  23. BACKUP_FILE_NAME := ${DATE}_DRAFT_Bachelorarbeit_${BRANCH}.pdf
  24. # Path to 'checkbiw'-script.
  25. # Do not forget to execute `git submodule update --init` first.
  26. CHECKBIW = checkbiw/src/checkbiw
  27. # The @-symbol makes the commands quite, i.e., make does not
  28. # output the commands it executes.
  29. QUIET = @
  30. .PHONY: default pdf clean check-french-spacing checkbiw stats watch
  31. default: pdf
  32. # Builds the PDF and creates a file with the format: "yyyy-MM-dd DRAFT Diplomarbeit - Branch <current branch>.pdf"
  33. # Is not dependent on anything because latexmk should figure out by itself if everything is fresh.
  34. pdf:
  35. $(LATEXMK) $(LATEXMK_FLAGS) $(DOC_TEX)
  36. cp $(DOC_PDF) backups/$(BACKUP_FILE_NAME)
  37. curl --netrc-file ../../serverkey/curl-cloud-access -T backups/$(BACKUP_FILE_NAME) https://cloud.constantin-fuerst.com/remote.php/dav/files/constantin/university/thesis-backup/$(BACKUP_FILE_NAME)
  38. # Performs a watch task, i.e. automatically re-builds everything quickly on changes.
  39. # If your PDF viewer supports a reload on file changes (such as the default PDF viewer in GNOME)
  40. # you get a cool productive working environment.
  41. #
  42. # The dependency to "pdf" exists only that in case something doesn't build from the beginning
  43. # the build immediately stops.
  44. #
  45. # Also see: https://paulklemm.com/blog/2016-03-06-watch-latex-documents-using-latexmk/
  46. watch: pdf
  47. $(LATEXMK) $(LATEXMK_WATCH_FLAGS) $(DOC_TEX)
  48. # Cleans all intermediate files except for the produced pdf files.
  49. clean:
  50. $(LATEXMK) -C
  51. $(QUIET)# latexmk does not clean up the aux-files produced by the chapters.
  52. $(QUIET)# They are stand-alone compilation units with a dedicated aux file.
  53. $(QUIET)# This comes because we include them with "\include" instead of "\input".
  54. find "./content" -type f -name "*.aux" | xargs -r rm
  55. $(QUIET)# Cleanup of "minted" package (if you use it - not included by default)
  56. $(QUIET)# find "./content" -type f -name "_minted*" | xargs -r rm -rf
  57. $(QUIET)# Produced by the 'make stats' target
  58. $(QUIET)rm -f bachelor.pdf.txt
  59. # Points out abbreviations and reminds you of escaping
  60. # the space after the period
  61. check-french-spacing: $(DOC_TEX_ALL_SORTED)
  62. $(QUIET)export GREP_COLOR='1;32'; \
  63. grep --color=auto "[A-Z]\(2,\)\." $+ || \
  64. grep --color=auto -e 'e\.g\.' -e 'i\.e\.' -e 'd\.h\.' $+ || \
  65. true
  66. # check for conformance with "bugs in writing", English only
  67. checkbiw: $(DOC_TEX_ALL_SORTED)
  68. $(QUIET)$(CHECKBIW) -v -c $+
  69. CMD_COUNT_PAGES = pdfinfo $(DOC_PDF) | awk '/^Pages:/ {print $$2}'
  70. CMD_COUNT_WORDS = pdftotext $(DOC_PDF) $(DOC_PDF:.pdf=.pdf.txt) && cat $(DOC_PDF:.pdf=.pdf.txt) | grep -E '^\.+\ *$$' -v | wc -w
  71. stats: pdf
  72. $(QUIET)echo "\e[1mThesis Stats:\e[0m"
  73. $(QUIET)echo " \e[1mdetexed sources and removed empty lines:\e[0m"
  74. $(QUIET)echo " lines: $(shell detex $(DOC_TEX_ALL_SORTED) | sed '/^$$/d' | wc -l)"
  75. $(QUIET)echo " words: $(shell detex $(DOC_TEX_ALL_SORTED) | sed '/^$$/d' | wc -w)"
  76. $(QUIET)echo " characters: $(shell detex $(DOC_TEX_ALL_SORTED) | sed '/^$$/d' | wc --chars)"
  77. $(QUIET)echo
  78. $(QUIET)echo " Please note: There are possibly deviations compared to the final PDF as the compiled"
  79. $(QUIET)echo " version might contain additional words, such as 'in Figure 3.5 on the"
  80. $(QUIET)echo " next page' or the bibliography."
  81. $(QUIET)echo
  82. $(QUIET)echo " \e[1mCompiled PDF:\e[0m"
  83. $(QUIET)echo " pages: $(shell $(CMD_COUNT_PAGES)) (in total)"
  84. $(QUIET)echo " words: $(shell $(CMD_COUNT_WORDS)) (roughly)"