Makefile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #######################################################################
  2. #
  3. # Makefile to compile all examples and convert them to LaTeX
  4. #
  5. #######################################################################
  6. # Compiler
  7. ifndef FPC
  8. ifdef PP
  9. FPC=$(PP)
  10. endif
  11. endif
  12. ifndef FPC
  13. FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
  14. ifneq ($(FPCPROG),)
  15. FPCPROG:=$(firstword $(FPCPROG))
  16. FPC:=$(shell $(FPCPROG) -PB)
  17. ifneq ($(findstring Error,$(FPC)),)
  18. override FPC=ppc386
  19. endif
  20. else
  21. override FPC=ppc386
  22. endif
  23. endif
  24. override FPC:=$(subst $(SRCEXEEXT),,$(FPC))
  25. override FPC:=$(subst \,/,$(FPC))$(SRCEXEEXT)
  26. # Unit directory
  27. # UNITDIR=/usr/lib/ppc/0.99.0/linuxunits
  28. # Any options you wish to pass.
  29. PPOPTS=
  30. # Script to convert the programs to LaTeX examples which can be included.
  31. PP2TEX=../pp2tex
  32. # Script to collect all examples in 1 file.
  33. MAKETEX=make1tex
  34. #######################################################################
  35. # No need to edit after this line.
  36. #######################################################################
  37. ifdef UNITDIR
  38. PPOPTS:=$(PPOPTS) -Up$(UNITDIR);
  39. endif
  40. .SUFFIXES: .pp .tex
  41. .PHONY: all tex clean execute
  42. OBJECTS=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 \
  43. ex11 ex12 ex13 ex14 ex15 ex16 ex17 ex18 ex19 ex20 \
  44. ex21 ex22 ex23 ex24 ex25 ex26 ex27 ex28 ex29 ex30 \
  45. ex31 ex32 ex33 ex34 ex35 ex36 ex37 ex38 ex39 ex40 \
  46. ex41 ex42 ex43 ex44 ex45 ex46 ex47 ex48 ex49 ex50
  47. TEXOBJECTS=$(addsuffix .tex, $(OBJECTS))
  48. # This is not the same list as objects, since some of the
  49. # tests are interactive.
  50. TOTEST=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 \
  51. ex11 ex12 ex13 ex14 ex15 ex16 ex17 ex18 ex19 ex20 \
  52. ex21 ex22 ex23 ex24 ex25 ex26 ex27 ex28 ex29 ex30 \
  53. ex31 ex32 ex33 ex34 ex35 ex36 ex37 ex38 ex39 ex40 \
  54. ex41 ex42 ex43 ex44 ex45 ex46 ex47 ex48 ex49 ex50
  55. LOGFILE=$(addsuffix .log, $(TOTEST))
  56. all : $(OBJECTS)
  57. tex : $(TEXOBJECTS)
  58. execute: $(LOGFILE)
  59. onetex : tex
  60. $(MAKETEX) $(TEXOBJECTS)
  61. clean :
  62. rm -f *.o *.s $(OBJECTS) $(TEXOBJECTS)
  63. rm -f *.ow *.sw *.exe *.dll *.log *.tmp
  64. $(OBJECTS): %: %.pp
  65. $(FPC) $(PPOPTS) $*
  66. $(TEXOBJECTS): %.tex: %.pp head.tex foot.tex
  67. $(PP2TEX) $*
  68. $(LOGFILE): %.log: %.exe
  69. $* > $*.log