daily pastebin goal
13%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CFLAGS=-Wall -ggdb
  2.  
  3. EXEC=lab1
  4. LIBS=list graph graphext
  5. NOHANDIN=graphext
  6. REPORT=report
  7. KALLKOD=kallkod
  8.  
  9. HANDINLIBS=$(filter-out $(NOHANDIN),$(LIBS))
  10. OBJS=$(LIBS:=.o) $(EXEC).o
  11. HANDIN=$(HANDINLIBS:=.c) $(EXEC).c $(EXEC).pdf
  12. HANDINTARGET=$(shell date +'%y%m%d%H%M')_$(EXEC).tar.gz
  13.  
  14. DIST=Makefile $(LIBS:=.o) $(LIBS:=.h) $(EXEC).c $(EXEC).dot $(EXEC).pdf $(REPORT).tex $(REPORT).bib $(REPORT).pdf
  15. DISTTARGET=lib$(EXEC).tar.gz
  16.  
  17. build: $(EXEC)
  18.  
  19. check: $(EXEC).pdf
  20.  
  21. debug: $(EXEC)
  22.     gdb $<
  23.  
  24. snapshot: handin
  25.  
  26. handin: $(HANDINTARGET)
  27.  
  28. handout: $(DISTTARGET)
  29.  
  30. $(EXEC): $(OBJS)
  31.  
  32. $(HANDINTARGET): $(HANDIN)
  33.     tar -czf $@ $(HANDIN)
  34.  
  35. $(DISTTARGET): $(DIST)
  36.     tar -czf $@ $(DIST)
  37.  
  38. $(EXEC).c: $(REPORT).tex
  39.     $(KALLKOD) < $<
  40.  
  41. $(REPORT).pdf: $(REPORT).tex $(REPORT).bbl $(EXEC).pdf
  42.     pdflatex $<
  43.     pdflatex $<
  44.  
  45. $(REPORT).bbl: $(REPORT).aux $(REPORT).bib
  46.     bibtex $<
  47.  
  48. $(REPORT).aux: $(REPORT).tex $(EXEC).pdf
  49.     pdflatex $<
  50.  
  51. clean:  $(EXEC).clean $(REPORT).cleanTeX
  52.  
  53. distclean: clean
  54.     rm -f $(OBJS) $(DISTTARGET) $(REPORT).pdf
  55.  
  56. proper: distclean
  57.     rm -f $(EXEC:=.c) $(LIBS:=.h)
  58.  
  59. %.dot: %
  60.     ./$<
  61.  
  62. %.pdf: %.dot
  63.     dot -Tpdf -o $@ $<
  64.  
  65. %.clean:
  66.     rm -f $(@:.clean=) $(@:.clean=.dot) $(@:.clean=.pdf)
  67.  
  68. %.cleanTeX:
  69.     rm -f $(@:.cleanTeX=.aux) $(@:.cleanTeX=.bbl) $(@:.cleanTeX=.blg) $(@:.cleanTeX=.log) $(@:.cleanTeX=.toc)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top